repo_id
stringclasses 563
values | file_path
stringlengths 40
166
| content
stringlengths 1
2.94M
| __index_level_0__
int64 0
0
|
|---|---|---|---|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/tx/priorityFeeCalculator.ts
|
import { ComputeBudgetProgram, TransactionInstruction } from '@solana/web3.js';
/**
* This class determines whether a priority fee needs to be included in a transaction based on
* a recent history of timed out transactions.
*/
export class PriorityFeeCalculator {
lastTxTimeoutCount: number;
priorityFeeTriggered: boolean;
lastTxTimeoutCountTriggered: number;
priorityFeeLatchDurationMs: number; // how long to stay in triggered state before resetting
/**
* Constructor for the PriorityFeeCalculator class.
* @param currentTimeMs - The current time in milliseconds.
* @param priorityFeeLatchDurationMs - The duration for how long to stay in triggered state before resetting. Default value is 10 seconds.
*/
constructor(
currentTimeMs: number,
priorityFeeLatchDurationMs: number = 10 * 1000
) {
this.lastTxTimeoutCount = 0;
this.priorityFeeTriggered = false;
this.lastTxTimeoutCountTriggered = currentTimeMs;
this.priorityFeeLatchDurationMs = priorityFeeLatchDurationMs;
}
/**
* Update the priority fee state based on the current time and the current timeout count.
* @param currentTimeMs current time in milliseconds
* @returns true if priority fee should be included in the next transaction
*/
public updatePriorityFee(
currentTimeMs: number,
txTimeoutCount: number
): boolean {
let triggerPriorityFee = false;
if (txTimeoutCount > this.lastTxTimeoutCount) {
this.lastTxTimeoutCount = txTimeoutCount;
this.lastTxTimeoutCountTriggered = currentTimeMs;
triggerPriorityFee = true;
} else {
if (!this.priorityFeeTriggered) {
triggerPriorityFee = false;
} else if (
currentTimeMs - this.lastTxTimeoutCountTriggered <
this.priorityFeeLatchDurationMs
) {
triggerPriorityFee = true;
}
}
this.priorityFeeTriggered = triggerPriorityFee;
return triggerPriorityFee;
}
/**
* This method returns a transaction instruction list that sets the compute limit on the ComputeBudget program.
* @param computeUnitLimit - The maximum number of compute units that can be used by the transaction.
* @returns An array of transaction instructions.
*/
public generateComputeBudgetIxs(
computeUnitLimit: number
): Array<TransactionInstruction> {
const ixs = [
ComputeBudgetProgram.setComputeUnitLimit({
units: computeUnitLimit,
}),
];
return ixs;
}
/**
* Calculates the compute unit price to use based on the desired additional fee to pay and the compute unit limit.
* @param computeUnitLimit desired CU to use
* @param additionalFeeMicroLamports desired additional fee to pay, in micro lamports
* @returns the compute unit price to use, in micro lamports
*/
public calculateComputeUnitPrice(
computeUnitLimit: number,
additionalFeeMicroLamports: number
): number {
return additionalFeeMicroLamports / computeUnitLimit;
}
/**
* This method generates a list of transaction instructions for the ComputeBudget program, and includes a priority fee if it's required
* @param computeUnitLimit - The maximum number of compute units that can be used by the transaction.
* @param usePriorityFee - A boolean indicating whether to include a priority fee in the transaction, this should be from `this.updatePriorityFee()` or `this.priorityFeeTriggered`.
* @param additionalFeeMicroLamports - The additional fee to be paid, in micro lamports, the actual price will be calculated.
* @returns An array of transaction instructions.
*/
public generateComputeBudgetWithPriorityFeeIx(
computeUnitLimit: number,
usePriorityFee: boolean,
additionalFeeMicroLamports: number
): Array<TransactionInstruction> {
const ixs = this.generateComputeBudgetIxs(computeUnitLimit);
if (usePriorityFee) {
const computeUnitPrice = this.calculateComputeUnitPrice(
computeUnitLimit,
additionalFeeMicroLamports
);
ixs.push(
ComputeBudgetProgram.setComputeUnitPrice({
microLamports: computeUnitPrice,
})
);
}
return ixs;
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/tx/baseTxSender.ts
|
import {
ConfirmationStrategy,
TxSender,
TxSendError,
TxSigAndSlot,
} from './types';
import {
Commitment,
ConfirmOptions,
Context,
RpcResponseAndContext,
Signer,
SignatureResult,
Transaction,
TransactionSignature,
Connection,
VersionedTransaction,
TransactionInstruction,
AddressLookupTableAccount,
BlockhashWithExpiryBlockHeight,
} from '@solana/web3.js';
import assert from 'assert';
import bs58 from 'bs58';
import { TxHandler } from './txHandler';
import { IWallet } from '../types';
import NodeCache from 'node-cache';
import { DEFAULT_CONFIRMATION_OPTS } from '../config';
import { NOT_CONFIRMED_ERROR_CODE } from '../constants/txConstants';
import { throwTransactionError } from './reportTransactionError';
const BASELINE_TX_LAND_RATE = 0.9;
const DEFAULT_TIMEOUT = 35000;
const DEFAULT_TX_LAND_RATE_LOOKBACK_WINDOW_MINUTES = 10;
export abstract class BaseTxSender implements TxSender {
connection: Connection;
wallet: IWallet;
opts: ConfirmOptions;
timeout: number;
additionalConnections: Connection[];
timeoutCount = 0;
confirmationStrategy: ConfirmationStrategy;
additionalTxSenderCallbacks: ((base58EncodedTx: string) => void)[];
txHandler: TxHandler;
trackTxLandRate?: boolean;
throwOnTimeoutError: boolean;
throwOnTransactionError: boolean;
// For landing rate calcs
lookbackWindowMinutes: number;
txSigCache?: NodeCache;
txLandRate = 0;
lastPriorityFeeSuggestion = 1;
landRateToFeeFunc: (landRate: number) => number;
public constructor({
connection,
wallet,
opts = DEFAULT_CONFIRMATION_OPTS,
timeout = DEFAULT_TIMEOUT,
additionalConnections = new Array<Connection>(),
confirmationStrategy = ConfirmationStrategy.Combo,
additionalTxSenderCallbacks,
trackTxLandRate,
txHandler,
txLandRateLookbackWindowMinutes = DEFAULT_TX_LAND_RATE_LOOKBACK_WINDOW_MINUTES,
landRateToFeeFunc,
throwOnTimeoutError = true,
throwOnTransactionError = true,
}: {
connection: Connection;
wallet: IWallet;
opts?: ConfirmOptions;
timeout?: number;
additionalConnections?;
confirmationStrategy?: ConfirmationStrategy;
additionalTxSenderCallbacks?: ((base58EncodedTx: string) => void)[];
txHandler?: TxHandler;
trackTxLandRate?: boolean;
txLandRateLookbackWindowMinutes?: number;
landRateToFeeFunc?: (landRate: number) => number;
throwOnTimeoutError?: boolean;
throwOnTransactionError?: boolean;
}) {
this.connection = connection;
this.wallet = wallet;
this.opts = opts;
this.timeout = timeout;
this.additionalConnections = additionalConnections;
this.confirmationStrategy = confirmationStrategy;
this.additionalTxSenderCallbacks = additionalTxSenderCallbacks;
this.txHandler =
txHandler ??
new TxHandler({
connection: this.connection,
wallet: this.wallet,
confirmationOptions: this.opts,
});
this.trackTxLandRate = trackTxLandRate;
this.lookbackWindowMinutes = txLandRateLookbackWindowMinutes * 60;
if (this.trackTxLandRate) {
this.txSigCache = new NodeCache({
stdTTL: this.lookbackWindowMinutes,
checkperiod: 120,
});
}
this.landRateToFeeFunc =
landRateToFeeFunc ?? this.defaultLandRateToFeeFunc.bind(this);
this.throwOnTimeoutError = throwOnTimeoutError;
this.throwOnTransactionError = throwOnTransactionError;
}
async send(
tx: Transaction,
additionalSigners?: Array<Signer>,
opts?: ConfirmOptions,
preSigned?: boolean
): Promise<TxSigAndSlot> {
if (additionalSigners === undefined) {
additionalSigners = [];
}
if (opts === undefined) {
opts = this.opts;
}
const signedTx = await this.prepareTx(
tx,
additionalSigners,
opts,
preSigned
);
return this.sendRawTransaction(signedTx.serialize(), opts);
}
async prepareTx(
tx: Transaction,
additionalSigners: Array<Signer>,
opts: ConfirmOptions,
preSigned?: boolean
): Promise<Transaction> {
return this.txHandler.prepareTx(
tx,
additionalSigners,
undefined,
opts,
preSigned
);
}
async getVersionedTransaction(
ixs: TransactionInstruction[],
lookupTableAccounts: AddressLookupTableAccount[],
_additionalSigners?: Array<Signer>,
opts?: ConfirmOptions,
blockhash?: BlockhashWithExpiryBlockHeight
): Promise<VersionedTransaction> {
return this.txHandler.generateVersionedTransaction(
blockhash,
ixs,
lookupTableAccounts,
this.wallet
);
}
async sendVersionedTransaction(
tx: VersionedTransaction,
additionalSigners?: Array<Signer>,
opts?: ConfirmOptions,
preSigned?: boolean
): Promise<TxSigAndSlot> {
let signedTx;
if (preSigned) {
signedTx = tx;
// @ts-ignore
} else if (this.wallet.payer) {
// @ts-ignore
tx.sign((additionalSigners ?? []).concat(this.wallet.payer));
signedTx = tx;
} else {
signedTx = await this.txHandler.signVersionedTx(
tx,
additionalSigners,
undefined,
this.wallet
);
}
if (opts === undefined) {
opts = this.opts;
}
return this.sendRawTransaction(signedTx.serialize(), opts);
}
async sendRawTransaction(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
rawTransaction: Buffer | Uint8Array,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
opts: ConfirmOptions
): Promise<TxSigAndSlot> {
throw new Error('Must be implemented by subclass');
}
/* Simulate the tx and return a boolean for success value */
async simulateTransaction(tx: VersionedTransaction): Promise<boolean> {
try {
const result = await this.connection.simulateTransaction(tx);
if (result.value.err != null) {
console.error('Error in transaction simulation: ', result.value.err);
return false;
}
return true;
} catch (e) {
console.error('Error calling simulateTransaction: ', e);
return false;
}
}
async confirmTransactionWebSocket(
signature: TransactionSignature,
commitment?: Commitment
): Promise<RpcResponseAndContext<SignatureResult>> {
let decodedSignature;
try {
decodedSignature = bs58.decode(signature);
} catch (err) {
throw new Error('signature must be base58 encoded: ' + signature);
}
assert(decodedSignature.length === 64, 'signature has invalid length');
const start = Date.now();
const subscriptionCommitment = commitment || this.opts.commitment;
const subscriptionIds = new Array<number>();
const connections = [this.connection, ...this.additionalConnections];
let response: RpcResponseAndContext<SignatureResult> | null = null;
const promises = connections.map((connection, i) => {
let subscriptionId;
const confirmPromise = new Promise((resolve, reject) => {
try {
subscriptionId = connection.onSignature(
signature,
(result: SignatureResult, context: Context) => {
subscriptionIds[i] = undefined;
response = {
context,
value: result,
};
resolve(null);
},
subscriptionCommitment
);
} catch (err) {
reject(err);
}
});
subscriptionIds.push(subscriptionId);
return confirmPromise;
});
try {
await this.promiseTimeout(promises, this.timeout);
} finally {
for (const [i, subscriptionId] of subscriptionIds.entries()) {
if (subscriptionId) {
connections[i].removeSignatureListener(subscriptionId);
}
}
}
if (response === null) {
if (this.confirmationStrategy === ConfirmationStrategy.Combo) {
try {
const rpcResponse = await this.connection.getSignatureStatuses([
signature,
]);
if (rpcResponse?.value?.[0]?.confirmationStatus) {
response = {
context: rpcResponse.context,
value: { err: rpcResponse.value[0].err },
};
return response;
}
} catch (error) {
// Ignore error to pass through to timeout error
}
}
this.timeoutCount += 1;
const duration = (Date.now() - start) / 1000;
if (this.throwOnTimeoutError) {
throw new TxSendError(
`Transaction was not confirmed in ${duration.toFixed(
2
)} seconds. It is unknown if it succeeded or failed. Check signature ${signature} using the Solana Explorer or CLI tools.`,
NOT_CONFIRMED_ERROR_CODE
);
}
}
return response;
}
async confirmTransactionPolling(
signature: TransactionSignature,
commitment: Commitment = 'finalized'
): Promise<RpcResponseAndContext<SignatureResult> | undefined> {
let totalTime = 0;
let backoffTime = 400; // approx block time
const start = Date.now();
while (totalTime < this.timeout) {
await new Promise((resolve) => setTimeout(resolve, backoffTime));
const rpcResponse = await this.connection.getSignatureStatuses([
signature,
]);
const signatureResult = rpcResponse && rpcResponse.value?.[0];
if (
rpcResponse &&
signatureResult &&
signatureResult.confirmationStatus === commitment
) {
return { context: rpcResponse.context, value: { err: null } };
}
totalTime += backoffTime;
backoffTime = Math.min(backoffTime * 2, 5000);
}
// Transaction not confirmed within 30 seconds
this.timeoutCount += 1;
const duration = (Date.now() - start) / 1000;
if (this.throwOnTimeoutError) {
throw new TxSendError(
`Transaction was not confirmed in ${duration.toFixed(
2
)} seconds. It is unknown if it succeeded or failed. Check signature ${signature} using the Solana Explorer or CLI tools.`,
NOT_CONFIRMED_ERROR_CODE
);
}
}
async confirmTransaction(
signature: TransactionSignature,
commitment?: Commitment
): Promise<RpcResponseAndContext<SignatureResult>> {
if (
this.confirmationStrategy === ConfirmationStrategy.WebSocket ||
this.confirmationStrategy === ConfirmationStrategy.Combo
) {
return await this.confirmTransactionWebSocket(signature, commitment);
} else if (this.confirmationStrategy === ConfirmationStrategy.Polling) {
return await this.confirmTransactionPolling(signature, commitment);
}
}
getTimestamp(): number {
return new Date().getTime();
}
promiseTimeout<T>(
promises: Promise<T>[],
timeoutMs: number
): Promise<T | null> {
let timeoutId: ReturnType<typeof setTimeout>;
const timeoutPromise: Promise<null> = new Promise((resolve) => {
timeoutId = setTimeout(() => resolve(null), timeoutMs);
});
return Promise.race([...promises, timeoutPromise]).then(
(result: T | null) => {
clearTimeout(timeoutId);
return result;
}
);
}
sendToAdditionalConnections(
rawTx: Buffer | Uint8Array,
opts: ConfirmOptions
): void {
this.additionalConnections.map((connection) => {
connection.sendRawTransaction(rawTx, opts).catch((e) => {
console.error(
// @ts-ignore
`error sending tx to additional connection ${connection._rpcEndpoint}`
);
console.error(e);
});
});
this.additionalTxSenderCallbacks?.map((callback) => {
callback(bs58.encode(rawTx));
});
}
public addAdditionalConnection(newConnection: Connection): void {
const alreadyUsingConnection =
this.additionalConnections.filter((connection) => {
// @ts-ignore
return connection._rpcEndpoint === newConnection.rpcEndpoint;
}).length > 0;
if (!alreadyUsingConnection) {
this.additionalConnections.push(newConnection);
}
}
public getTimeoutCount(): number {
return this.timeoutCount;
}
public async checkConfirmationResultForError(
txSig: string,
result: SignatureResult
): Promise<void> {
if (result?.err) {
await throwTransactionError(
txSig,
this.connection,
this.opts?.commitment
);
}
return;
}
public getTxLandRate(): number {
if (!this.trackTxLandRate) {
console.warn(
'trackTxLandRate is false, returning default land rate of 0'
);
return this.txLandRate;
}
const keys = this.txSigCache.keys();
const denominator = keys.length;
if (denominator === 0) {
return this.txLandRate;
}
let numerator = 0;
for (const key of keys) {
const value = this.txSigCache.get(key);
if (value) {
numerator += 1;
}
}
this.txLandRate = numerator / denominator;
return this.txLandRate;
}
private defaultLandRateToFeeFunc(txLandRate: number) {
if (
txLandRate >= BASELINE_TX_LAND_RATE ||
this.txSigCache.keys().length < 3
) {
return 1;
}
const multiplier =
10 * Math.log10(1 + (BASELINE_TX_LAND_RATE - txLandRate) * 5);
return Math.min(multiplier, 10);
}
public getSuggestedPriorityFeeMultiplier(): number {
if (!this.trackTxLandRate) {
console.warn(
'trackTxLandRate is false, returning default multiplier of 1'
);
return 1;
}
return this.landRateToFeeFunc(this.getTxLandRate());
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/tx/utils.ts
|
import { Transaction, VersionedTransaction } from '@solana/web3.js';
export const isVersionedTransaction = (
tx: Transaction | VersionedTransaction
): boolean => {
const version = (tx as VersionedTransaction)?.version;
const isVersionedTx =
tx instanceof VersionedTransaction || version !== undefined;
return isVersionedTx;
};
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/tx/retryTxSender.ts
|
import { ConfirmationStrategy, TxSigAndSlot } from './types';
import { ConfirmOptions, Connection } from '@solana/web3.js';
import { BaseTxSender } from './baseTxSender';
import { TxHandler } from './txHandler';
import { IWallet } from '../types';
import { DEFAULT_CONFIRMATION_OPTS } from '../config';
const DEFAULT_TIMEOUT = 35000;
const DEFAULT_RETRY = 2000;
type ResolveReference = {
resolve?: () => void;
};
export class RetryTxSender extends BaseTxSender {
connection: Connection;
wallet: IWallet;
opts: ConfirmOptions;
timeout: number;
retrySleep: number;
additionalConnections: Connection[];
timoutCount = 0;
public constructor({
connection,
wallet,
opts = { ...DEFAULT_CONFIRMATION_OPTS, maxRetries: 0 },
timeout = DEFAULT_TIMEOUT,
retrySleep = DEFAULT_RETRY,
additionalConnections = new Array<Connection>(),
confirmationStrategy = ConfirmationStrategy.Combo,
additionalTxSenderCallbacks = [],
txHandler,
trackTxLandRate,
txLandRateLookbackWindowMinutes,
landRateToFeeFunc,
throwOnTimeoutError = true,
}: {
connection: Connection;
wallet: IWallet;
opts?: ConfirmOptions;
timeout?: number;
retrySleep?: number;
additionalConnections?;
confirmationStrategy?: ConfirmationStrategy;
additionalTxSenderCallbacks?: ((base58EncodedTx: string) => void)[];
txHandler?: TxHandler;
trackTxLandRate?: boolean;
txLandRateLookbackWindowMinutes?: number;
landRateToFeeFunc?: (landRate: number) => number;
throwOnTimeoutError?: boolean;
}) {
super({
connection,
wallet,
opts,
timeout,
additionalConnections,
confirmationStrategy,
additionalTxSenderCallbacks,
txHandler,
trackTxLandRate,
txLandRateLookbackWindowMinutes,
landRateToFeeFunc,
throwOnTimeoutError,
});
this.connection = connection;
this.wallet = wallet;
this.opts = opts;
this.timeout = timeout;
this.retrySleep = retrySleep;
this.additionalConnections = additionalConnections;
}
async sleep(reference: ResolveReference): Promise<void> {
return new Promise((resolve) => {
reference.resolve = resolve;
setTimeout(resolve, this.retrySleep);
});
}
async sendRawTransaction(
rawTransaction: Buffer | Uint8Array,
opts: ConfirmOptions
): Promise<TxSigAndSlot> {
const startTime = this.getTimestamp();
const txid = await this.connection.sendRawTransaction(rawTransaction, opts);
this.txSigCache?.set(txid, false);
this.sendToAdditionalConnections(rawTransaction, opts);
let done = false;
const resolveReference: ResolveReference = {
resolve: undefined,
};
const stopWaiting = () => {
done = true;
if (resolveReference.resolve) {
resolveReference.resolve();
}
};
(async () => {
while (!done && this.getTimestamp() - startTime < this.timeout) {
await this.sleep(resolveReference);
if (!done) {
this.connection
.sendRawTransaction(rawTransaction, opts)
.catch((e) => {
console.error(e);
stopWaiting();
});
this.sendToAdditionalConnections(rawTransaction, opts);
}
}
})();
let slot: number;
try {
const result = await this.confirmTransaction(txid, opts.commitment);
this.txSigCache?.set(txid, true);
await this.checkConfirmationResultForError(txid, result?.value);
slot = result?.context?.slot;
// eslint-disable-next-line no-useless-catch
} catch (e) {
throw e;
} finally {
stopWaiting();
}
return { txSig: txid, slot };
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/tx/types.ts
|
import {
AddressLookupTableAccount,
BlockhashWithExpiryBlockHeight,
ConfirmOptions,
Signer,
Transaction,
TransactionInstruction,
TransactionSignature,
VersionedTransaction,
} from '@solana/web3.js';
import { IWallet } from '../types';
export enum ConfirmationStrategy {
WebSocket = 'websocket',
Polling = 'polling',
Combo = 'combo',
}
export type TxSigAndSlot = {
txSig: TransactionSignature;
slot: number;
};
export interface TxSender {
wallet: IWallet;
send(
tx: Transaction,
additionalSigners?: Array<Signer>,
opts?: ConfirmOptions,
preSigned?: boolean
): Promise<TxSigAndSlot>;
sendVersionedTransaction(
tx: VersionedTransaction,
additionalSigners?: Array<Signer>,
opts?: ConfirmOptions,
preSigned?: boolean
): Promise<TxSigAndSlot>;
getVersionedTransaction(
ixs: TransactionInstruction[],
lookupTableAccounts: AddressLookupTableAccount[],
additionalSigners?: Array<Signer>,
opts?: ConfirmOptions,
blockhash?: BlockhashWithExpiryBlockHeight
): Promise<VersionedTransaction>;
sendRawTransaction(
rawTransaction: Buffer | Uint8Array,
opts: ConfirmOptions
): Promise<TxSigAndSlot>;
simulateTransaction(tx: VersionedTransaction): Promise<boolean>;
getTimeoutCount(): number;
getSuggestedPriorityFeeMultiplier(): number;
getTxLandRate(): number;
}
export class TxSendError extends Error {
constructor(
public message: string,
public code: number
) {
super(message);
if (Error.captureStackTrace) {
Error.captureStackTrace(this, TxSendError);
}
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/tx/reportTransactionError.ts
|
import {
Commitment,
Connection,
Finality,
SendTransactionError,
VersionedTransactionResponse,
} from '@solana/web3.js';
import { DEFAULT_CONFIRMATION_OPTS } from '../config';
/**
* The new getTransaction method expects a Finality type instead of a Commitment type. The only options for Finality are 'confirmed' and 'finalized'.
* @param commitment
* @returns
*/
const commitmentToFinality = (commitment: Commitment): Finality => {
switch (commitment) {
case 'confirmed':
return 'confirmed';
case 'finalized':
return 'finalized';
default:
throw new Error(
`Invalid commitment when reporting transaction error. The commitment must be 'confirmed' or 'finalized' but was given '${commitment}'. If you're using this commitment for a specific reason, you may need to roll your own logic here.`
);
}
};
const getTransactionResult = async (
txSig: string,
connection: Connection,
commitment?: Commitment
): Promise<VersionedTransactionResponse> => {
const finality = commitmentToFinality(
commitment || connection.commitment || DEFAULT_CONFIRMATION_OPTS.commitment
);
return await connection.getTransaction(txSig, {
maxSupportedTransactionVersion: 0,
commitment: finality,
});
};
const getTransactionResultWithRetry = async (
txSig: string,
connection: Connection,
commitment?: Commitment
): Promise<VersionedTransactionResponse> => {
const start = Date.now();
const retryTimeout = 3_000; // Timeout after 3 seconds
const retryInterval = 800; // Retry with 800ms interval
const retryCount = 3; // Retry 3 times
let currentCount = 0;
let transactionResult = await getTransactionResult(
txSig,
connection,
commitment
);
// Retry 3 times or until timeout as long as we don't have a result yet
while (
!transactionResult &&
Date.now() - start < retryTimeout &&
currentCount < retryCount
) {
// Sleep for 1 second :: Do this first so that we don't run the first loop immediately after the initial fetch above
await new Promise((resolve) => setTimeout(resolve, retryInterval));
transactionResult = await getTransactionResult(
txSig,
connection,
commitment
);
currentCount++;
}
return transactionResult;
};
/**
* THROWS if there is an error
*
* Should only be used for a txSig that is confirmed has an error. There is a race-condition where sometimes the transaction is not instantly available to fetch after the confirmation has already failed with an error, so this method has retry logic which we don't want to do wastefully. This method will throw a generic error if it can't get the transaction result after a retry period.
* @param txSig
* @param connection
* @returns
*/
export const throwTransactionError = async (
txSig: string,
connection: Connection,
commitment?: Commitment
): Promise<void> => {
const err = await getTransactionErrorFromTxSig(txSig, connection, commitment);
if (err) {
throw err;
}
return;
};
/**
* RETURNS an error if there is one
*
* Should only be used for a txSig that is confirmed has an error. There is a race-condition where sometimes the transaction is not instantly available to fetch after the confirmation has already failed with an error, so this method has retry logic which we don't want to do wastefully. This method will throw a generic error if it can't get the transaction result after a retry period.
* @param txSig
* @param connection
* @returns
*/
export const getTransactionErrorFromTxSig = async (
txSig: string,
connection: Connection,
commitment?: Commitment
): Promise<SendTransactionError> => {
const transactionResult = await getTransactionResultWithRetry(
txSig,
connection,
commitment
);
if (!transactionResult) {
// Throw a generic error because we couldn't get the transaction result for the given txSig
return new SendTransactionError({
action: 'send',
signature: txSig,
transactionMessage: `Transaction Failed`,
});
}
if (!transactionResult?.meta?.err) {
// Assume that the transaction was successful and we are here erroneously because we have a result with no error
return;
}
return getTransactionError(transactionResult);
};
export const getTransactionError = (
transactionResult: VersionedTransactionResponse
): SendTransactionError => {
if (!transactionResult?.meta?.err) {
return;
}
const logs = transactionResult?.meta?.logMessages ?? ['No logs'];
const lastLog = logs[logs.length - 1];
const friendlyMessage = lastLog?.match(/(failed:) (.+)/)?.[2];
return new SendTransactionError({
action: 'send',
signature: transactionResult?.transaction?.signatures?.[0],
transactionMessage: `Transaction Failed${
friendlyMessage ? `: ${friendlyMessage}` : ''
}`,
logs,
});
};
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/tx/fastSingleTxSender.ts
|
import { ConfirmationStrategy, TxSigAndSlot } from './types';
import {
ConfirmOptions,
TransactionSignature,
Connection,
Commitment,
BlockhashWithExpiryBlockHeight,
} from '@solana/web3.js';
import { BaseTxSender } from './baseTxSender';
import { TxHandler } from './txHandler';
import { IWallet } from '../types';
import { DEFAULT_CONFIRMATION_OPTS } from '../config';
const DEFAULT_TIMEOUT = 35000;
const DEFAULT_BLOCKHASH_REFRESH = 10000;
export class FastSingleTxSender extends BaseTxSender {
connection: Connection;
wallet: IWallet;
opts: ConfirmOptions;
timeout: number;
blockhashRefreshInterval: number;
additionalConnections: Connection[];
timoutCount = 0;
recentBlockhash: BlockhashWithExpiryBlockHeight;
skipConfirmation: boolean;
confirmInBackground: boolean;
blockhashCommitment: Commitment;
blockhashIntervalId: NodeJS.Timer;
public constructor({
connection,
wallet,
opts = { ...DEFAULT_CONFIRMATION_OPTS, maxRetries: 0 },
timeout = DEFAULT_TIMEOUT,
blockhashRefreshInterval = DEFAULT_BLOCKHASH_REFRESH,
additionalConnections = new Array<Connection>(),
skipConfirmation = false,
confirmInBackground = false,
blockhashCommitment = 'finalized',
confirmationStrategy = ConfirmationStrategy.Combo,
trackTxLandRate,
txHandler,
txLandRateLookbackWindowMinutes,
landRateToFeeFunc,
throwOnTimeoutError = true,
}: {
connection: Connection;
wallet: IWallet;
opts?: ConfirmOptions;
timeout?: number;
blockhashRefreshInterval?: number;
additionalConnections?;
skipConfirmation?: boolean;
confirmInBackground?: boolean;
blockhashCommitment?: Commitment;
confirmationStrategy?: ConfirmationStrategy;
trackTxLandRate?: boolean;
txHandler?: TxHandler;
txLandRateLookbackWindowMinutes?: number;
landRateToFeeFunc?: (landRate: number) => number;
throwOnTimeoutError?: boolean;
}) {
super({
connection,
wallet,
opts,
timeout,
additionalConnections,
confirmationStrategy,
txHandler,
trackTxLandRate,
txLandRateLookbackWindowMinutes,
landRateToFeeFunc,
throwOnTimeoutError,
});
this.connection = connection;
this.wallet = wallet;
this.opts = opts;
this.timeout = timeout;
this.blockhashRefreshInterval = blockhashRefreshInterval;
this.additionalConnections = additionalConnections;
this.skipConfirmation = skipConfirmation;
this.confirmInBackground = confirmInBackground;
this.blockhashCommitment = blockhashCommitment;
this.startBlockhashRefreshLoop();
}
startBlockhashRefreshLoop(): void {
if (this.blockhashRefreshInterval > 0) {
this.blockhashIntervalId = setInterval(async () => {
try {
this.recentBlockhash = await this.connection.getLatestBlockhash(
this.blockhashCommitment
);
} catch (e) {
console.error('Error in startBlockhashRefreshLoop: ', e);
}
}, this.blockhashRefreshInterval);
}
}
async sendRawTransaction(
rawTransaction: Buffer | Uint8Array,
opts: ConfirmOptions
): Promise<TxSigAndSlot> {
let txid: TransactionSignature;
try {
txid = await this.connection.sendRawTransaction(rawTransaction, opts);
this.txSigCache?.set(txid, false);
this.sendToAdditionalConnections(rawTransaction, opts);
} catch (e) {
console.error(e);
throw e;
}
let slot: number;
if (!this.skipConfirmation) {
try {
if (this.confirmInBackground) {
this.confirmTransaction(txid, opts.commitment).then(
async (result) => {
this.txSigCache?.set(txid, true);
await this.checkConfirmationResultForError(txid, result?.value);
slot = result.context.slot;
}
);
} else {
const result = await this.confirmTransaction(txid, opts.commitment);
this.txSigCache?.set(txid, true);
await this.checkConfirmationResultForError(txid, result?.value);
slot = result?.context?.slot;
}
} catch (e) {
console.error(e);
throw e;
}
}
return { txSig: txid, slot };
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/tx/forwardOnlyTxSender.ts
|
import {
ConfirmOptions,
Connection,
VersionedTransaction,
} from '@solana/web3.js';
import bs58 from 'bs58';
import { BaseTxSender } from './baseTxSender';
import { ConfirmationStrategy, TxSigAndSlot } from './types';
import { TxHandler } from './txHandler';
import { IWallet } from '../types';
import { DEFAULT_CONFIRMATION_OPTS } from '../config';
const DEFAULT_TIMEOUT = 35000;
const DEFAULT_RETRY = 5000;
type ResolveReference = {
resolve?: () => void;
};
export class ForwardOnlyTxSender extends BaseTxSender {
connection: Connection;
wallet: IWallet;
opts: ConfirmOptions;
timeout: number;
retrySleep: number;
additionalConnections: Connection[];
timoutCount = 0;
public constructor({
connection,
wallet,
opts = { ...DEFAULT_CONFIRMATION_OPTS, maxRetries: 0 },
timeout = DEFAULT_TIMEOUT,
retrySleep = DEFAULT_RETRY,
confirmationStrategy = ConfirmationStrategy.Combo,
additionalTxSenderCallbacks = [],
txHandler,
trackTxLandRate,
txLandRateLookbackWindowMinutes,
landRateToFeeFunc,
throwOnTimeoutError = true,
}: {
connection: Connection;
wallet: IWallet;
opts?: ConfirmOptions;
timeout?: number;
retrySleep?: number;
confirmationStrategy?: ConfirmationStrategy;
additionalTxSenderCallbacks?: ((base58EncodedTx: string) => void)[];
txHandler?: TxHandler;
trackTxLandRate?: boolean;
txLandRateLookbackWindowMinutes?: number;
landRateToFeeFunc?: (landRate: number) => number;
throwOnTimeoutError?: boolean;
}) {
super({
connection,
wallet,
opts,
timeout,
additionalConnections: [],
confirmationStrategy,
additionalTxSenderCallbacks,
txHandler,
trackTxLandRate,
txLandRateLookbackWindowMinutes,
landRateToFeeFunc,
throwOnTimeoutError,
});
this.connection = connection;
this.wallet = wallet;
this.opts = opts;
this.timeout = timeout;
this.retrySleep = retrySleep;
this.additionalConnections = [];
}
async sleep(reference: ResolveReference): Promise<void> {
return new Promise((resolve) => {
reference.resolve = resolve;
setTimeout(resolve, this.retrySleep);
});
}
sendToAdditionalConnections(
rawTx: Buffer | Uint8Array,
_opts: ConfirmOptions
): void {
this.additionalTxSenderCallbacks?.map((callback) => {
callback(bs58.encode(rawTx));
});
}
async sendRawTransaction(
rawTransaction: Buffer | Uint8Array,
opts: ConfirmOptions
): Promise<TxSigAndSlot> {
const deserializedTx = VersionedTransaction.deserialize(rawTransaction);
const txSig = deserializedTx.signatures[0];
const encodedTxSig = bs58.encode(txSig);
const startTime = this.getTimestamp();
this.sendToAdditionalConnections(rawTransaction, opts);
this.txSigCache?.set(encodedTxSig, false);
let done = false;
const resolveReference: ResolveReference = {
resolve: undefined,
};
const stopWaiting = () => {
done = true;
if (resolveReference.resolve) {
resolveReference.resolve();
}
};
(async () => {
while (!done && this.getTimestamp() - startTime < this.timeout) {
await this.sleep(resolveReference);
if (!done) {
this.sendToAdditionalConnections(rawTransaction, opts);
}
}
})();
let slot: number;
try {
const result = await this.confirmTransaction(
encodedTxSig,
opts.commitment
);
slot = result?.context?.slot;
this.txSigCache?.set(encodedTxSig, true);
// eslint-disable-next-line no-useless-catch
} catch (e) {
throw e;
} finally {
stopWaiting();
}
return { txSig: encodedTxSig, slot };
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/tx/txHandler.ts
|
import {
AddressLookupTableAccount,
BlockhashWithExpiryBlockHeight,
Commitment,
ComputeBudgetProgram,
ConfirmOptions,
Connection,
Message,
MessageV0,
Signer,
Transaction,
TransactionInstruction,
TransactionMessage,
TransactionVersion,
VersionedTransaction,
} from '@solana/web3.js';
import { TransactionParamProcessor } from './txParamProcessor';
import bs58 from 'bs58';
import {
BaseTxParams,
DriftClientMetricsEvents,
IWallet,
MappedRecord,
SignedTxData,
TxParams,
} from '../types';
import { containsComputeUnitIxs } from '../util/computeUnits';
import { CachedBlockhashFetcher } from './blockhashFetcher/cachedBlockhashFetcher';
import { BaseBlockhashFetcher } from './blockhashFetcher/baseBlockhashFetcher';
import { BlockhashFetcher } from './blockhashFetcher/types';
import { isVersionedTransaction } from './utils';
import { DEFAULT_CONFIRMATION_OPTS } from '../config';
/**
* Explanation for SIGNATURE_BLOCK_AND_EXPIRY:
*
* When the whileValidTxSender waits for confirmation of a given transaction, it needs the last available blockheight and blockhash used in the signature to do so. For pre-signed transactions, these values aren't attached to the transaction object by default. For a "scrappy" workaround which doesn't break backwards compatibility, the SIGNATURE_BLOCK_AND_EXPIRY property is simply attached to the transaction objects as they are created or signed in this handler despite a mismatch in the typescript types. If the values are attached to the transaction when they reach the whileValidTxSender, it can opt-in to use these values.
*/
const DEV_TRY_FORCE_TX_TIMEOUTS =
process.env.DEV_TRY_FORCE_TX_TIMEOUTS === 'true' || false;
export const COMPUTE_UNITS_DEFAULT = 200_000;
const BLOCKHASH_FETCH_RETRY_COUNT = 3;
const BLOCKHASH_FETCH_RETRY_SLEEP = 200;
const RECENT_BLOCKHASH_STALE_TIME_MS = 2_000; // Reuse blockhashes within this timeframe during bursts of tx contruction
export type TxBuildingProps = {
instructions: TransactionInstruction | TransactionInstruction[];
txVersion: TransactionVersion;
connection: Connection;
preFlightCommitment: Commitment;
fetchMarketLookupTableAccount: () => Promise<AddressLookupTableAccount>;
lookupTables?: AddressLookupTableAccount[];
forceVersionedTransaction?: boolean;
txParams?: TxParams;
recentBlockhash?: BlockhashWithExpiryBlockHeight;
wallet?: IWallet;
};
export type TxHandlerConfig = {
blockhashCachingEnabled?: boolean;
blockhashCachingConfig?: {
retryCount: number;
retrySleepTimeMs: number;
staleCacheTimeMs: number;
};
};
/**
* This class is responsible for creating and signing transactions.
*/
export class TxHandler {
private blockHashToLastValidBlockHeightLookup: Record<string, number> = {};
private returnBlockHeightsWithSignedTxCallbackData = false;
private connection: Connection;
private wallet: IWallet;
private confirmationOptions: ConfirmOptions;
private preSignedCb?: () => void;
private onSignedCb?: (txSigs: DriftClientMetricsEvents['txSigned']) => void;
private blockhashCommitment: Commitment =
DEFAULT_CONFIRMATION_OPTS.commitment;
private blockHashFetcher: BlockhashFetcher;
constructor(props: {
connection: Connection;
wallet: IWallet;
confirmationOptions: ConfirmOptions;
opts?: {
returnBlockHeightsWithSignedTxCallbackData?: boolean;
onSignedCb?: (txSigs: DriftClientMetricsEvents['txSigned']) => void;
preSignedCb?: () => void;
};
config?: TxHandlerConfig;
}) {
this.connection = props.connection;
this.wallet = props.wallet;
this.confirmationOptions = props.confirmationOptions;
this.blockhashCommitment =
props.confirmationOptions?.preflightCommitment ??
props?.connection?.commitment ??
this.blockhashCommitment ??
'confirmed';
this.blockHashFetcher = props?.config?.blockhashCachingEnabled
? new CachedBlockhashFetcher(
this.connection,
this.blockhashCommitment,
props?.config?.blockhashCachingConfig?.retryCount ??
BLOCKHASH_FETCH_RETRY_COUNT,
props?.config?.blockhashCachingConfig?.retrySleepTimeMs ??
BLOCKHASH_FETCH_RETRY_SLEEP,
props?.config?.blockhashCachingConfig?.staleCacheTimeMs ??
RECENT_BLOCKHASH_STALE_TIME_MS
)
: new BaseBlockhashFetcher(this.connection, this.blockhashCommitment);
// #Optionals
this.returnBlockHeightsWithSignedTxCallbackData =
props.opts?.returnBlockHeightsWithSignedTxCallbackData ?? false;
this.onSignedCb = props.opts?.onSignedCb;
this.preSignedCb = props.opts?.preSignedCb;
}
private addHashAndExpiryToLookup(
hashAndExpiry: BlockhashWithExpiryBlockHeight
) {
if (!this.returnBlockHeightsWithSignedTxCallbackData) return;
this.blockHashToLastValidBlockHeightLookup[hashAndExpiry.blockhash] =
hashAndExpiry.lastValidBlockHeight;
}
private getProps = (wallet?: IWallet, confirmationOpts?: ConfirmOptions) =>
[wallet ?? this.wallet, confirmationOpts ?? this.confirmationOptions] as [
IWallet,
ConfirmOptions,
];
public updateWallet(wallet: IWallet) {
this.wallet = wallet;
}
/**
* Created this to prevent non-finalized blockhashes being used when building transactions. We want to always use finalized because otherwise it's easy to get the BlockHashNotFound error (RPC uses finalized to validate a transaction). Using an older blockhash when building transactions should never really be a problem right now.
*
* https://www.helius.dev/blog/how-to-deal-with-blockhash-errors-on-solana#why-do-blockhash-errors-occur
*
* @returns
*/
public async getLatestBlockhashForTransaction() {
return this.blockHashFetcher.getLatestBlockhash();
}
/**
* Applies recent blockhash and signs a given transaction
* @param tx
* @param additionalSigners
* @param wallet
* @param confirmationOpts
* @param preSigned
* @param recentBlockhash
* @returns
*/
public async prepareTx(
tx: Transaction,
additionalSigners: Array<Signer>,
wallet?: IWallet,
confirmationOpts?: ConfirmOptions,
preSigned?: boolean,
recentBlockhash?: BlockhashWithExpiryBlockHeight
): Promise<Transaction> {
if (preSigned) {
return tx;
}
[wallet, confirmationOpts] = this.getProps(wallet, confirmationOpts);
tx.feePayer = wallet.publicKey;
recentBlockhash = recentBlockhash
? recentBlockhash
: await this.getLatestBlockhashForTransaction();
tx.recentBlockhash = recentBlockhash.blockhash;
this.addHashAndExpiryToLookup(recentBlockhash);
const signedTx = await this.signTx(tx, additionalSigners);
// @ts-ignore
signedTx.SIGNATURE_BLOCK_AND_EXPIRY = recentBlockhash;
return signedTx;
}
private isVersionedTransaction(
tx: Transaction | VersionedTransaction
): boolean {
return isVersionedTransaction(tx);
}
private isLegacyTransaction(tx: Transaction | VersionedTransaction) {
return !this.isVersionedTransaction(tx);
}
private getTxSigFromSignedTx(signedTx: Transaction | VersionedTransaction) {
if (this.isVersionedTransaction(signedTx)) {
return bs58.encode(
Buffer.from((signedTx as VersionedTransaction).signatures[0])
) as string;
} else {
return bs58.encode(
Buffer.from((signedTx as Transaction).signature)
) as string;
}
}
private getBlockhashFromSignedTx(
signedTx: Transaction | VersionedTransaction
) {
if (this.isVersionedTransaction(signedTx)) {
return (signedTx as VersionedTransaction).message.recentBlockhash;
} else {
return (signedTx as Transaction).recentBlockhash;
}
}
private async signTx(
tx: Transaction,
additionalSigners: Array<Signer>,
wallet?: IWallet
): Promise<Transaction> {
[wallet] = this.getProps(wallet);
additionalSigners
.filter((s): s is Signer => s !== undefined)
.forEach((kp) => {
tx.partialSign(kp);
});
this.preSignedCb?.();
const signedTx = await wallet.signTransaction(tx);
// Turn txSig Buffer into base58 string
const txSig = this.getTxSigFromSignedTx(signedTx);
this.handleSignedTxData([
{
txSig,
signedTx,
blockHash: this.getBlockhashFromSignedTx(signedTx),
},
]);
return signedTx;
}
public async signVersionedTx(
tx: VersionedTransaction,
additionalSigners: Array<Signer>,
recentBlockhash?: BlockhashWithExpiryBlockHeight,
wallet?: IWallet
): Promise<VersionedTransaction> {
[wallet] = this.getProps(wallet);
if (recentBlockhash) {
tx.message.recentBlockhash = recentBlockhash.blockhash;
this.addHashAndExpiryToLookup(recentBlockhash);
// @ts-ignore
tx.SIGNATURE_BLOCK_AND_EXPIRY = recentBlockhash;
}
additionalSigners
?.filter((s): s is Signer => s !== undefined)
.forEach((kp) => {
tx.sign([kp]);
});
this.preSignedCb?.();
//@ts-ignore
const signedTx = (await wallet.signTransaction(tx)) as VersionedTransaction;
// Turn txSig Buffer into base58 string
const txSig = this.getTxSigFromSignedTx(signedTx);
this.handleSignedTxData([
{
txSig,
signedTx,
blockHash: this.getBlockhashFromSignedTx(signedTx),
},
]);
return signedTx;
}
private handleSignedTxData(
txData: Omit<SignedTxData, 'lastValidBlockHeight'>[]
) {
if (!this.returnBlockHeightsWithSignedTxCallbackData) {
if (this.onSignedCb) {
this.onSignedCb(txData);
}
return;
}
const signedTxData = txData.map((tx) => {
const lastValidBlockHeight =
this.blockHashToLastValidBlockHeightLookup[tx.blockHash];
return {
...tx,
lastValidBlockHeight,
};
});
if (this.onSignedCb) {
this.onSignedCb(signedTxData);
}
return signedTxData;
}
/**
* Gets transaction params with extra processing applied, like using the simulated compute units or using a dynamically calculated compute unit price.
* @param txBuildingProps
* @returns
*/
private async getProcessedTransactionParams(
txBuildingProps: TxBuildingProps
): Promise<BaseTxParams> {
const baseTxParams: BaseTxParams = {
computeUnits: txBuildingProps?.txParams?.computeUnits,
computeUnitsPrice: txBuildingProps?.txParams?.computeUnitsPrice,
};
const processedTxParams = await TransactionParamProcessor.process({
baseTxParams,
txBuilder: (updatedTxParams) =>
this.buildTransaction({
...txBuildingProps,
txParams: updatedTxParams.txParams ?? baseTxParams,
forceVersionedTransaction: true,
}) as Promise<VersionedTransaction>,
processConfig: {
useSimulatedComputeUnits:
txBuildingProps.txParams.useSimulatedComputeUnits,
computeUnitsBufferMultiplier:
txBuildingProps.txParams.computeUnitsBufferMultiplier,
useSimulatedComputeUnitsForCUPriceCalculation:
txBuildingProps.txParams
.useSimulatedComputeUnitsForCUPriceCalculation,
getCUPriceFromComputeUnits:
txBuildingProps.txParams.getCUPriceFromComputeUnits,
},
processParams: {
connection: this.connection,
},
});
return processedTxParams;
}
private _generateVersionedTransaction(
recentBlockhash: BlockhashWithExpiryBlockHeight,
message: Message | MessageV0
) {
this.addHashAndExpiryToLookup(recentBlockhash);
return new VersionedTransaction(message);
}
public generateLegacyVersionedTransaction(
recentBlockhash: BlockhashWithExpiryBlockHeight,
ixs: TransactionInstruction[],
wallet?: IWallet
) {
[wallet] = this.getProps(wallet);
const message = new TransactionMessage({
payerKey: wallet.publicKey,
recentBlockhash: recentBlockhash.blockhash,
instructions: ixs,
}).compileToLegacyMessage();
const tx = this._generateVersionedTransaction(recentBlockhash, message);
// @ts-ignore
tx.SIGNATURE_BLOCK_AND_EXPIRY = recentBlockhash;
return tx;
}
public generateVersionedTransaction(
recentBlockhash: BlockhashWithExpiryBlockHeight,
ixs: TransactionInstruction[],
lookupTableAccounts: AddressLookupTableAccount[],
wallet?: IWallet
) {
[wallet] = this.getProps(wallet);
const message = new TransactionMessage({
payerKey: wallet.publicKey,
recentBlockhash: recentBlockhash.blockhash,
instructions: ixs,
}).compileToV0Message(lookupTableAccounts);
const tx = this._generateVersionedTransaction(recentBlockhash, message);
// @ts-ignore
tx.SIGNATURE_BLOCK_AND_EXPIRY = recentBlockhash;
return tx;
}
public generateLegacyTransaction(
ixs: TransactionInstruction[],
recentBlockhash?: BlockhashWithExpiryBlockHeight
) {
const tx = new Transaction().add(...ixs);
if (recentBlockhash) {
tx.recentBlockhash = recentBlockhash.blockhash;
}
return tx;
}
/**
* Accepts multiple instructions and builds a transaction for each. Prevents needing to spam RPC with requests for the same blockhash.
* @param props
* @returns
*/
public async buildBulkTransactions(
props: Omit<TxBuildingProps, 'instructions'> & {
instructions: (TransactionInstruction | TransactionInstruction[])[];
}
) {
const recentBlockhash =
props?.recentBlockhash ?? (await this.getLatestBlockhashForTransaction());
return await Promise.all(
props.instructions.map((ix) => {
if (!ix) return undefined;
return this.buildTransaction({
...props,
instructions: ix,
recentBlockhash,
});
})
);
}
/**
*
* @param instructions
* @param txParams
* @param txVersion
* @param lookupTables
* @param forceVersionedTransaction Return a VersionedTransaction instance even if the version of the transaction is Legacy
* @returns
*/
public async buildTransaction(
props: TxBuildingProps
): Promise<Transaction | VersionedTransaction> {
const {
instructions,
txVersion,
txParams,
connection: _connection,
preFlightCommitment: _preFlightCommitment,
fetchMarketLookupTableAccount,
forceVersionedTransaction,
} = props;
let { lookupTables } = props;
// # Collect and process Tx Params
let baseTxParams: BaseTxParams = {
computeUnits: txParams?.computeUnits,
computeUnitsPrice: txParams?.computeUnitsPrice,
};
if (txParams?.useSimulatedComputeUnits) {
const processedTxParams = await this.getProcessedTransactionParams(props);
baseTxParams = {
...baseTxParams,
...processedTxParams,
};
}
const instructionsArray = Array.isArray(instructions)
? instructions
: [instructions];
const { hasSetComputeUnitLimitIx, hasSetComputeUnitPriceIx } =
containsComputeUnitIxs(instructionsArray);
// # Create Tx Instructions
const allIx = [];
const computeUnits = baseTxParams?.computeUnits;
if (computeUnits > 0 && !hasSetComputeUnitLimitIx) {
allIx.push(
ComputeBudgetProgram.setComputeUnitLimit({
units: computeUnits,
})
);
}
const computeUnitsPrice = baseTxParams?.computeUnitsPrice;
if (DEV_TRY_FORCE_TX_TIMEOUTS) {
allIx.push(
ComputeBudgetProgram.setComputeUnitPrice({
microLamports: 0,
})
);
} else if (computeUnitsPrice > 0 && !hasSetComputeUnitPriceIx) {
allIx.push(
ComputeBudgetProgram.setComputeUnitPrice({
microLamports: computeUnitsPrice,
})
);
}
allIx.push(...instructionsArray);
const recentBlockhash =
props?.recentBlockhash ?? (await this.getLatestBlockhashForTransaction());
// # Create and return Transaction
if (txVersion === 'legacy') {
if (forceVersionedTransaction) {
return this.generateLegacyVersionedTransaction(recentBlockhash, allIx);
} else {
return this.generateLegacyTransaction(allIx, recentBlockhash);
}
} else {
const marketLookupTable = await fetchMarketLookupTableAccount();
lookupTables = lookupTables
? [...lookupTables, marketLookupTable]
: [marketLookupTable];
return this.generateVersionedTransaction(
recentBlockhash,
allIx,
lookupTables
);
}
}
public wrapInTx(
instruction: TransactionInstruction,
computeUnits = 600_000,
computeUnitsPrice = 0
): Transaction {
const tx = new Transaction();
if (computeUnits != COMPUTE_UNITS_DEFAULT) {
tx.add(
ComputeBudgetProgram.setComputeUnitLimit({
units: computeUnits,
})
);
}
if (DEV_TRY_FORCE_TX_TIMEOUTS) {
tx.add(
ComputeBudgetProgram.setComputeUnitPrice({
microLamports: 0,
})
);
} else if (computeUnitsPrice != 0) {
tx.add(
ComputeBudgetProgram.setComputeUnitPrice({
microLamports: computeUnitsPrice,
})
);
}
return tx.add(instruction);
}
/**
* Get a map of signed and prepared transactions from an array of legacy transactions
* @param txsToSign
* @param keys
* @param wallet
* @param commitment
* @returns
*/
public async getPreparedAndSignedLegacyTransactionMap<
T extends Record<string, Transaction | undefined>,
>(
txsMap: T,
wallet?: IWallet,
commitment?: Commitment,
recentBlockhash?: BlockhashWithExpiryBlockHeight
) {
recentBlockhash = recentBlockhash
? recentBlockhash
: await this.getLatestBlockhashForTransaction();
this.addHashAndExpiryToLookup(recentBlockhash);
for (const tx of Object.values(txsMap)) {
if (!tx) continue;
tx.recentBlockhash = recentBlockhash.blockhash;
tx.feePayer = wallet?.publicKey ?? this.wallet?.publicKey;
// @ts-ignore
tx.SIGNATURE_BLOCK_AND_EXPIRY = recentBlockhash;
}
return this.getSignedTransactionMap(txsMap, wallet);
}
/**
* Get a map of signed transactions from an array of transactions to sign.
* @param txsToSign
* @param keys
* @param wallet
* @returns
*/
public async getSignedTransactionMap<
T extends Record<string, Transaction | VersionedTransaction | undefined>,
>(
txsToSignMap: T,
wallet?: IWallet
): Promise<{
signedTxMap: T;
signedTxData: SignedTxData[];
}> {
[wallet] = this.getProps(wallet);
const txsToSignEntries = Object.entries(txsToSignMap);
// Create a map of the same keys as the input map, but with the values set to undefined. We'll populate the filtered (non-undefined) values with signed transactions.
const signedTxMap = txsToSignEntries.reduce((acc, [key]) => {
acc[key] = undefined;
return acc;
}, {}) as T;
const filteredTxEntries = txsToSignEntries.filter(([_, tx]) => !!tx);
// Extra handling for legacy transactions
for (const [_key, tx] of filteredTxEntries) {
if (this.isLegacyTransaction(tx)) {
(tx as Transaction).feePayer = wallet.publicKey;
}
}
this.preSignedCb?.();
const signedFilteredTxs = await wallet.signAllTransactions(
filteredTxEntries.map(([_, tx]) => tx as Transaction)
);
signedFilteredTxs.forEach((signedTx, index) => {
// @ts-ignore
signedTx.SIGNATURE_BLOCK_AND_EXPIRY =
// @ts-ignore
filteredTxEntries[index][1]?.SIGNATURE_BLOCK_AND_EXPIRY;
});
const signedTxData = this.handleSignedTxData(
signedFilteredTxs.map((signedTx) => {
return {
txSig: this.getTxSigFromSignedTx(signedTx),
signedTx,
blockHash: this.getBlockhashFromSignedTx(signedTx),
};
})
);
filteredTxEntries.forEach(([key], index) => {
const signedTx = signedFilteredTxs[index];
// @ts-ignore
signedTxMap[key] = signedTx;
});
return { signedTxMap, signedTxData };
}
/**
* Accepts multiple instructions and builds a transaction for each. Prevents needing to spam RPC with requests for the same blockhash.
* @param props
* @returns
*/
public async buildTransactionsMap<
T extends Record<string, TransactionInstruction | TransactionInstruction[]>,
>(
props: Omit<TxBuildingProps, 'instructions'> & {
instructionsMap: T;
}
): Promise<MappedRecord<T, Transaction | VersionedTransaction>> {
const builtTxs = await this.buildBulkTransactions({
...props,
instructions: Object.values(props.instructionsMap),
});
return Object.keys(props.instructionsMap).reduce((acc, key, index) => {
acc[key] = builtTxs[index];
return acc;
}, {}) as MappedRecord<T, Transaction | VersionedTransaction>;
}
/**
* Builds and signs transactions from a given array of instructions for multiple transactions.
* @param props
* @returns
*/
public async buildAndSignTransactionMap<
T extends Record<string, TransactionInstruction | TransactionInstruction[]>,
>(
props: Omit<TxBuildingProps, 'instructions'> & {
instructionsMap: T;
}
) {
const builtTxs = await this.buildTransactionsMap(props);
const preppedTransactions = await (props.txVersion === 'legacy'
? this.getPreparedAndSignedLegacyTransactionMap(
builtTxs as Record<string, Transaction>,
props.wallet,
props.preFlightCommitment
)
: this.getSignedTransactionMap(builtTxs, props.wallet));
return preppedTransactions;
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/tx/whileValidTxSender.ts
|
import { ConfirmationStrategy, TxSigAndSlot } from './types';
import {
ConfirmOptions,
Connection,
SendTransactionError,
Signer,
Transaction,
VersionedTransaction,
} from '@solana/web3.js';
import { BaseTxSender } from './baseTxSender';
import bs58 from 'bs58';
import { TxHandler } from './txHandler';
import { IWallet } from '../types';
import { DEFAULT_CONFIRMATION_OPTS } from '../config';
const DEFAULT_RETRY = 2000;
type ResolveReference = {
resolve?: () => void;
};
export class WhileValidTxSender extends BaseTxSender {
connection: Connection;
wallet: IWallet;
opts: ConfirmOptions;
timeout: number;
retrySleep: number;
additionalConnections: Connection[];
timoutCount = 0;
untilValid = new Map<
string,
{ blockhash: string; lastValidBlockHeight: number }
>();
useBlockHeightOffset = true;
private async checkAndSetUseBlockHeightOffset() {
this.connection.getVersion().then((version) => {
const solanaCoreVersion = version['solana-core'];
if (!solanaCoreVersion) return;
const majorVersion = solanaCoreVersion.split('.')[0];
if (!majorVersion) return;
const parsedMajorVersion = parseInt(majorVersion);
if (isNaN(parsedMajorVersion)) return;
if (parsedMajorVersion >= 2) {
this.useBlockHeightOffset = false;
} else {
this.useBlockHeightOffset = true;
}
});
}
public constructor({
connection,
wallet,
opts = { ...DEFAULT_CONFIRMATION_OPTS, maxRetries: 0 },
retrySleep = DEFAULT_RETRY,
additionalConnections = new Array<Connection>(),
confirmationStrategy = ConfirmationStrategy.Combo,
additionalTxSenderCallbacks = [],
txHandler,
trackTxLandRate,
txLandRateLookbackWindowMinutes,
landRateToFeeFunc,
throwOnTimeoutError = true,
throwOnTransactionError = true,
}: {
connection: Connection;
wallet: IWallet;
opts?: ConfirmOptions;
retrySleep?: number;
additionalConnections?;
additionalTxSenderCallbacks?: ((base58EncodedTx: string) => void)[];
confirmationStrategy?: ConfirmationStrategy;
txHandler?: TxHandler;
trackTxLandRate?: boolean;
txLandRateLookbackWindowMinutes?: number;
landRateToFeeFunc?: (landRate: number) => number;
throwOnTimeoutError?: boolean;
throwOnTransactionError?: boolean;
}) {
super({
connection,
wallet,
opts,
additionalConnections,
additionalTxSenderCallbacks,
txHandler,
trackTxLandRate,
txLandRateLookbackWindowMinutes,
confirmationStrategy,
landRateToFeeFunc,
throwOnTimeoutError,
throwOnTransactionError,
});
this.retrySleep = retrySleep;
this.checkAndSetUseBlockHeightOffset();
}
async sleep(reference: ResolveReference): Promise<void> {
return new Promise((resolve) => {
reference.resolve = resolve;
setTimeout(resolve, this.retrySleep);
});
}
async prepareTx(
tx: Transaction,
additionalSigners: Array<Signer>,
opts: ConfirmOptions,
preSigned?: boolean
): Promise<Transaction> {
let latestBlockhash =
await this.txHandler.getLatestBlockhashForTransaction();
// handle tx
let signedTx = tx;
if (!preSigned) {
signedTx = await this.txHandler.prepareTx(
tx,
additionalSigners,
undefined,
opts,
false,
latestBlockhash
);
}
// See SIGNATURE_BLOCK_AND_EXPIRY explanation in txHandler.ts if this is confusing
// @ts-ignore
if (preSigned && tx.SIGNATURE_BLOCK_AND_EXPIRY) {
// @ts-ignore
latestBlockhash = tx.SIGNATURE_BLOCK_AND_EXPIRY;
}
// handle subclass-specific side effects
const txSig = bs58.encode(
signedTx?.signature || signedTx.signatures[0]?.signature
);
this.untilValid.set(txSig, latestBlockhash);
return signedTx;
}
async sendVersionedTransaction(
tx: VersionedTransaction,
additionalSigners?: Array<Signer>,
opts?: ConfirmOptions,
preSigned?: boolean
): Promise<TxSigAndSlot> {
let latestBlockhash =
await this.txHandler.getLatestBlockhashForTransaction();
let signedTx;
if (preSigned) {
signedTx = tx;
// See SIGNATURE_BLOCK_AND_EXPIRY explanation in txHandler.ts if this is confusing
// @ts-ignore
if (tx.SIGNATURE_BLOCK_AND_EXPIRY) {
// @ts-ignore
latestBlockhash = tx.SIGNATURE_BLOCK_AND_EXPIRY;
}
// @ts-ignore
} else if (this.wallet.payer) {
tx.message.recentBlockhash = latestBlockhash.blockhash;
// @ts-ignore
tx.sign((additionalSigners ?? []).concat(this.wallet.payer));
signedTx = tx;
} else {
tx.message.recentBlockhash = latestBlockhash.blockhash;
additionalSigners
?.filter((s): s is Signer => s !== undefined)
.forEach((kp) => {
tx.sign([kp]);
});
signedTx = await this.txHandler.signVersionedTx(
tx,
additionalSigners,
latestBlockhash
);
}
if (opts === undefined) {
opts = this.opts;
}
const txSig = bs58.encode(signedTx.signatures[0]);
this.untilValid.set(txSig, latestBlockhash);
return this.sendRawTransaction(signedTx.serialize(), opts);
}
async sendRawTransaction(
rawTransaction: Buffer | Uint8Array,
opts: ConfirmOptions
): Promise<TxSigAndSlot> {
const startTime = this.getTimestamp();
const txid = await this.connection.sendRawTransaction(rawTransaction, opts);
this.txSigCache?.set(txid, false);
this.sendToAdditionalConnections(rawTransaction, opts);
let done = false;
const resolveReference: ResolveReference = {
resolve: undefined,
};
const stopWaiting = () => {
done = true;
if (resolveReference.resolve) {
resolveReference.resolve();
}
};
(async () => {
while (!done && this.getTimestamp() - startTime < this.timeout) {
await this.sleep(resolveReference);
if (!done) {
this.connection
.sendRawTransaction(rawTransaction, opts)
.catch((e) => {
console.error(e);
stopWaiting();
});
this.sendToAdditionalConnections(rawTransaction, opts);
}
}
})();
let slot: number;
try {
const result = await this.confirmTransaction(txid, opts.commitment);
this.txSigCache?.set(txid, true);
await this.checkConfirmationResultForError(txid, result?.value);
if (result?.value?.err && this.throwOnTransactionError) {
// Fallback error handling if there's a problem reporting the error in checkConfirmationResultForError
throw new SendTransactionError({
action: 'send',
signature: txid,
transactionMessage: `Transaction Failed`,
});
}
slot = result?.context?.slot;
// eslint-disable-next-line no-useless-catch
} catch (e) {
throw e;
} finally {
stopWaiting();
}
return { txSig: txid, slot };
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/tx
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/tx/blockhashFetcher/baseBlockhashFetcher.ts
|
import {
BlockhashWithExpiryBlockHeight,
Commitment,
Connection,
} from '@solana/web3.js';
import { BlockhashFetcher } from './types';
export class BaseBlockhashFetcher implements BlockhashFetcher {
constructor(
private connection: Connection,
private blockhashCommitment: Commitment
) {}
public async getLatestBlockhash(): Promise<
BlockhashWithExpiryBlockHeight | undefined
> {
return this.connection.getLatestBlockhash(this.blockhashCommitment);
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/tx
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/tx/blockhashFetcher/types.ts
|
import { BlockhashWithExpiryBlockHeight } from '@solana/web3.js';
export interface BlockhashFetcher {
getLatestBlockhash(): Promise<BlockhashWithExpiryBlockHeight | undefined>;
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/tx
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/tx/blockhashFetcher/cachedBlockhashFetcher.ts
|
import {
BlockhashWithExpiryBlockHeight,
Commitment,
Connection,
} from '@solana/web3.js';
import { BlockhashFetcher } from './types';
/**
* Fetches the latest blockhash and caches it for a configurable amount of time.
*
* - Prevents RPC spam by reusing cached values
* - Retries on failure with exponential backoff
* - Prevents concurrent requests for the same blockhash
*/
export class CachedBlockhashFetcher implements BlockhashFetcher {
private recentBlockhashCache: {
value: BlockhashWithExpiryBlockHeight | undefined;
lastUpdated: number;
} = { value: undefined, lastUpdated: 0 };
private blockhashFetchingPromise: Promise<void> | null = null;
constructor(
private connection: Connection,
private blockhashCommitment: Commitment,
private retryCount: number,
private retrySleepTimeMs: number,
private staleCacheTimeMs: number
) {}
private async fetchBlockhashWithRetry(): Promise<BlockhashWithExpiryBlockHeight> {
for (let i = 0; i < this.retryCount; i++) {
try {
return await this.connection.getLatestBlockhash(
this.blockhashCommitment
);
} catch (err) {
if (i === this.retryCount - 1) {
throw new Error('Failed to fetch blockhash after maximum retries');
}
await this.sleep(this.retrySleepTimeMs * 2 ** i);
}
}
throw new Error('Failed to fetch blockhash after maximum retries');
}
private sleep(ms: number): Promise<void> {
return new Promise((resolve) => setTimeout(resolve, ms));
}
private async updateBlockhashCache(): Promise<void> {
const result = await this.fetchBlockhashWithRetry();
this.recentBlockhashCache = {
value: result,
lastUpdated: Date.now(),
};
}
public async getLatestBlockhash(): Promise<
BlockhashWithExpiryBlockHeight | undefined
> {
if (this.isCacheStale()) {
await this.refreshBlockhash();
}
return this.recentBlockhashCache.value;
}
private isCacheStale(): boolean {
const lastUpdateTime = this.recentBlockhashCache.lastUpdated;
return (
!lastUpdateTime || Date.now() > lastUpdateTime + this.staleCacheTimeMs
);
}
/**
* Refresh the blockhash cache, await a pending refresh if it exists
*/
private async refreshBlockhash(): Promise<void> {
if (!this.blockhashFetchingPromise) {
this.blockhashFetchingPromise = this.updateBlockhashCache();
try {
await this.blockhashFetchingPromise;
} finally {
this.blockhashFetchingPromise = null;
}
} else {
await this.blockhashFetchingPromise;
}
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/decode/phoenix.ts
|
import {
MarketData,
marketHeaderBeet,
OrderId,
RestingOrder,
TraderState,
getUiOrderSequenceNumber,
sign,
toNum,
toBN,
} from '@ellipsis-labs/phoenix-sdk';
import * as beet from '@metaplex-foundation/beet';
export const orderIdBeet = new beet.BeetArgsStruct<OrderId>(
[
['priceInTicks', beet.u64],
['orderSequenceNumber', beet.u64],
],
'fIFOOrderId'
);
export const restingOrderBeet = new beet.BeetArgsStruct<RestingOrder>(
[
['traderIndex', beet.u64],
['numBaseLots', beet.u64],
['lastValidSlot', beet.u64],
['lastValidUnixTimestampInSeconds', beet.u64],
],
'fIFORestingOrder'
);
function deserializeRedBlackTree<Key, Value>(
data: Buffer,
keyDeserializer: beet.BeetArgsStruct<Key>,
valueDeserializer: beet.BeetArgsStruct<Value>
): Map<Key, Value> {
const tree = new Map<Key, Value>();
const treeNodes = deserializeRedBlackTreeNodes(
data,
keyDeserializer,
valueDeserializer
);
const nodes = treeNodes[0];
const freeNodes = treeNodes[1];
for (const [index, [key, value]] of nodes.entries()) {
if (!freeNodes.has(index)) {
tree.set(key, value);
}
}
return tree;
}
function deserializeRedBlackTreeNodes<Key, Value>(
data: Buffer,
keyDeserializer: beet.BeetArgsStruct<Key>,
valueDeserializer: beet.BeetArgsStruct<Value>
): [Array<[Key, Value]>, Set<number>] {
let offset = 0;
const keySize = keyDeserializer.byteSize;
const valueSize = valueDeserializer.byteSize;
const nodes = new Array<[Key, Value]>();
// Skip RBTree header
offset += 16;
// Skip node allocator size
offset += 8;
const bumpIndex = data.readInt32LE(offset);
offset += 4;
let freeListHead = data.readInt32LE(offset);
offset += 4;
const freeListPointers = new Array<[number, number]>();
for (let index = 0; offset < data.length && index < bumpIndex - 1; index++) {
const registers = new Array<number>();
for (let i = 0; i < 4; i++) {
registers.push(data.readInt32LE(offset)); // skip padding
offset += 4;
}
const [key] = keyDeserializer.deserialize(
data.subarray(offset, offset + keySize)
);
offset += keySize;
const [value] = valueDeserializer.deserialize(
data.subarray(offset, offset + valueSize)
);
offset += valueSize;
nodes.push([key, value]);
freeListPointers.push([index, registers[0]]);
}
const freeNodes = new Set<number>();
let indexToRemove = freeListHead - 1;
let counter = 0;
// If there's an infinite loop here, that means that the state is corrupted
while (freeListHead < bumpIndex) {
// We need to subtract 1 because the node allocator is 1-indexed
const next = freeListPointers[freeListHead - 1];
[indexToRemove, freeListHead] = next;
freeNodes.add(indexToRemove);
counter += 1;
if (counter > bumpIndex) {
throw new Error('Infinite loop detected');
}
}
return [nodes, freeNodes];
}
export const fastDecode = (buffer: Buffer): MarketData => {
let offset = marketHeaderBeet.byteSize;
const [header] = marketHeaderBeet.deserialize(buffer.subarray(0, offset));
const paddingLen = 8 * 32;
let remaining = buffer.subarray(offset + paddingLen);
offset = 0;
const baseLotsPerBaseUnit = Number(remaining.readBigUInt64LE(offset));
offset += 8;
const quoteLotsPerBaseUnitPerTick = Number(remaining.readBigUInt64LE(offset));
offset += 8;
const sequenceNumber = Number(remaining.readBigUInt64LE(offset));
offset += 8;
const takerFeeBps = Number(remaining.readBigUInt64LE(offset));
offset += 8;
const collectedQuoteLotFees = Number(remaining.readBigUInt64LE(offset));
offset += 8;
const unclaimedQuoteLotFees = Number(remaining.readBigUInt64LE(offset));
offset += 8;
remaining = remaining.subarray(offset);
const totalNumBids = toNum(header.marketSizeParams.bidsSize);
const totalNumAsks = toNum(header.marketSizeParams.asksSize);
const totalBidsSize =
16 +
16 +
(16 + orderIdBeet.byteSize + restingOrderBeet.byteSize) * totalNumBids;
const totalAsksSize =
16 +
16 +
(16 + orderIdBeet.byteSize + restingOrderBeet.byteSize) * totalNumAsks;
offset = 0;
const bidBuffer = remaining.subarray(offset, offset + totalBidsSize);
offset += totalBidsSize;
const askBuffer = remaining.subarray(offset, offset + totalAsksSize);
const bidsUnsorted = deserializeRedBlackTree(
bidBuffer,
orderIdBeet,
restingOrderBeet
);
const asksUnsorted = deserializeRedBlackTree(
askBuffer,
orderIdBeet,
restingOrderBeet
);
const bids = [...bidsUnsorted].sort((a, b) => {
const priceComparison = sign(
toBN(b[0].priceInTicks).sub(toBN(a[0].priceInTicks))
);
if (priceComparison !== 0) {
return priceComparison;
}
return sign(
getUiOrderSequenceNumber(a[0]).sub(getUiOrderSequenceNumber(b[0]))
);
});
const asks = [...asksUnsorted].sort((a, b) => {
const priceComparison = sign(
toBN(a[0].priceInTicks).sub(toBN(b[0].priceInTicks))
);
if (priceComparison !== 0) {
return priceComparison;
}
return sign(
getUiOrderSequenceNumber(a[0]).sub(getUiOrderSequenceNumber(b[0]))
);
});
const traders = new Map<string, TraderState>();
const traderPubkeyToTraderIndex = new Map<string, number>();
const traderIndexToTraderPubkey = new Map<number, string>();
return {
header,
baseLotsPerBaseUnit,
quoteLotsPerBaseUnitPerTick,
sequenceNumber,
takerFeeBps,
collectedQuoteLotFees,
unclaimedQuoteLotFees,
bids,
asks,
traders,
traderPubkeyToTraderIndex,
traderIndexToTraderPubkey,
};
};
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/decode/user.ts
|
import {
MarketType,
Order,
OrderStatus,
OrderTriggerCondition,
OrderType,
PerpPosition,
PositionDirection,
SpotBalanceType,
SpotPosition,
UserAccount,
} from '../types';
import { PublicKey } from '@solana/web3.js';
import { BN, MarginMode } from '../';
import { ZERO } from '../';
function readUnsignedBigInt64LE(buffer: Buffer, offset: number): BN {
return new BN(buffer.subarray(offset, offset + 8), 10, 'le');
}
function readSignedBigInt64LE(buffer: Buffer, offset: number): BN {
const unsignedValue = new BN(buffer.subarray(offset, offset + 8), 10, 'le');
if (unsignedValue.testn(63)) {
const inverted = unsignedValue.notn(64).addn(1);
return inverted.neg();
} else {
return unsignedValue;
}
}
export function decodeUser(buffer: Buffer): UserAccount {
let offset = 8;
const authority = new PublicKey(buffer.slice(offset, offset + 32));
offset += 32;
const delegate = new PublicKey(buffer.slice(offset, offset + 32));
offset += 32;
const name = [];
for (let i = 0; i < 32; i++) {
name.push(buffer.readUint8(offset + i));
}
offset += 32;
const spotPositions: SpotPosition[] = [];
for (let i = 0; i < 8; i++) {
const scaledBalance = readUnsignedBigInt64LE(buffer, offset);
const openOrders = buffer.readUInt8(offset + 35);
if (scaledBalance.eq(ZERO) && openOrders === 0) {
offset += 40;
continue;
}
offset += 8;
const openBids = readSignedBigInt64LE(buffer, offset);
offset += 8;
const openAsks = readSignedBigInt64LE(buffer, offset);
offset += 8;
const cumulativeDeposits = readSignedBigInt64LE(buffer, offset);
offset += 8;
const marketIndex = buffer.readUInt16LE(offset);
offset += 2;
const balanceTypeNum = buffer.readUInt8(offset);
let balanceType: SpotBalanceType;
if (balanceTypeNum === 0) {
balanceType = SpotBalanceType.DEPOSIT;
} else {
balanceType = SpotBalanceType.BORROW;
}
offset += 6;
spotPositions.push({
scaledBalance,
openBids,
openAsks,
cumulativeDeposits,
marketIndex,
balanceType,
openOrders,
});
}
const perpPositions: PerpPosition[] = [];
for (let i = 0; i < 8; i++) {
const baseAssetAmount = readSignedBigInt64LE(buffer, offset + 8);
const quoteAssetAmount = readSignedBigInt64LE(buffer, offset + 16);
const lpShares = readUnsignedBigInt64LE(buffer, offset + 64);
const openOrders = buffer.readUInt8(offset + 94);
if (
baseAssetAmount.eq(ZERO) &&
openOrders === 0 &&
quoteAssetAmount.eq(ZERO) &&
lpShares.eq(ZERO)
) {
offset += 96;
continue;
}
const lastCumulativeFundingRate = readSignedBigInt64LE(buffer, offset);
offset += 24;
const quoteBreakEvenAmount = readSignedBigInt64LE(buffer, offset);
offset += 8;
const quoteEntryAmount = readSignedBigInt64LE(buffer, offset);
offset += 8;
const openBids = readSignedBigInt64LE(buffer, offset);
offset += 8;
const openAsks = readSignedBigInt64LE(buffer, offset);
offset += 8;
const settledPnl = readSignedBigInt64LE(buffer, offset);
offset += 16;
const lastBaseAssetAmountPerLp = readSignedBigInt64LE(buffer, offset);
offset += 8;
const lastQuoteAssetAmountPerLp = readSignedBigInt64LE(buffer, offset);
offset += 8;
const remainderBaseAssetAmount = buffer.readInt32LE(offset);
offset += 4;
const marketIndex = buffer.readUInt16LE(offset);
offset += 3;
const perLpBase = buffer.readUInt8(offset);
offset += 1;
perpPositions.push({
lastCumulativeFundingRate,
baseAssetAmount,
quoteAssetAmount,
quoteBreakEvenAmount,
quoteEntryAmount,
openBids,
openAsks,
settledPnl,
lpShares,
lastBaseAssetAmountPerLp,
lastQuoteAssetAmountPerLp,
remainderBaseAssetAmount,
marketIndex,
openOrders,
perLpBase,
});
}
const orders: Order[] = [];
for (let i = 0; i < 32; i++) {
// skip order if it's not open
if (buffer.readUint8(offset + 82) === 0) {
offset += 96;
continue;
}
const slot = readUnsignedBigInt64LE(buffer, offset);
offset += 8;
const price = readUnsignedBigInt64LE(buffer, offset);
offset += 8;
const baseAssetAmount = readUnsignedBigInt64LE(buffer, offset);
offset += 8;
const baseAssetAmountFilled = readUnsignedBigInt64LE(buffer, offset);
offset += 8;
const quoteAssetAmountFilled = readUnsignedBigInt64LE(buffer, offset);
offset += 8;
const triggerPrice = readUnsignedBigInt64LE(buffer, offset);
offset += 8;
const auctionStartPrice = readSignedBigInt64LE(buffer, offset);
offset += 8;
const auctionEndPrice = readSignedBigInt64LE(buffer, offset);
offset += 8;
const maxTs = readSignedBigInt64LE(buffer, offset);
offset += 8;
const oraclePriceOffset = buffer.readInt32LE(offset);
offset += 4;
const orderId = buffer.readUInt32LE(offset);
offset += 4;
const marketIndex = buffer.readUInt16LE(offset);
offset += 2;
const orderStatusNum = buffer.readUInt8(offset);
let status: OrderStatus;
if (orderStatusNum === 0) {
status = OrderStatus.INIT;
} else if (orderStatusNum === 1) {
status = OrderStatus.OPEN;
}
offset += 1;
const orderTypeNum = buffer.readUInt8(offset);
let orderType: OrderType;
if (orderTypeNum === 0) {
orderType = OrderType.MARKET;
} else if (orderTypeNum === 1) {
orderType = OrderType.LIMIT;
} else if (orderTypeNum === 2) {
orderType = OrderType.TRIGGER_MARKET;
} else if (orderTypeNum === 3) {
orderType = OrderType.TRIGGER_LIMIT;
} else if (orderTypeNum === 4) {
orderType = OrderType.ORACLE;
}
offset += 1;
const marketTypeNum = buffer.readUInt8(offset);
let marketType: MarketType;
if (marketTypeNum === 0) {
marketType = MarketType.SPOT;
} else {
marketType = MarketType.PERP;
}
offset += 1;
const userOrderId = buffer.readUint8(offset);
offset += 1;
const existingPositionDirectionNum = buffer.readUInt8(offset);
let existingPositionDirection: PositionDirection;
if (existingPositionDirectionNum === 0) {
existingPositionDirection = PositionDirection.LONG;
} else {
existingPositionDirection = PositionDirection.SHORT;
}
offset += 1;
const positionDirectionNum = buffer.readUInt8(offset);
let direction: PositionDirection;
if (positionDirectionNum === 0) {
direction = PositionDirection.LONG;
} else {
direction = PositionDirection.SHORT;
}
offset += 1;
const reduceOnly = buffer.readUInt8(offset) === 1;
offset += 1;
const postOnly = buffer.readUInt8(offset) === 1;
offset += 1;
const immediateOrCancel = buffer.readUInt8(offset) === 1;
offset += 1;
const triggerConditionNum = buffer.readUInt8(offset);
let triggerCondition: OrderTriggerCondition;
if (triggerConditionNum === 0) {
triggerCondition = OrderTriggerCondition.ABOVE;
} else if (triggerConditionNum === 1) {
triggerCondition = OrderTriggerCondition.BELOW;
} else if (triggerConditionNum === 2) {
triggerCondition = OrderTriggerCondition.TRIGGERED_ABOVE;
} else if (triggerConditionNum === 3) {
triggerCondition = OrderTriggerCondition.TRIGGERED_BELOW;
}
offset += 1;
const auctionDuration = buffer.readUInt8(offset);
offset += 1;
offset += 3; // padding
orders.push({
slot,
price,
baseAssetAmount,
quoteAssetAmount: undefined,
baseAssetAmountFilled,
quoteAssetAmountFilled,
triggerPrice,
auctionStartPrice,
auctionEndPrice,
maxTs,
oraclePriceOffset,
orderId,
marketIndex,
status,
orderType,
marketType,
userOrderId,
existingPositionDirection,
direction,
reduceOnly,
postOnly,
immediateOrCancel,
triggerCondition,
auctionDuration,
});
}
const lastAddPerpLpSharesTs = readSignedBigInt64LE(buffer, offset);
offset += 8;
const totalDeposits = readUnsignedBigInt64LE(buffer, offset);
offset += 8;
const totalWithdraws = readUnsignedBigInt64LE(buffer, offset);
offset += 8;
const totalSocialLoss = readUnsignedBigInt64LE(buffer, offset);
offset += 8;
const settledPerpPnl = readSignedBigInt64LE(buffer, offset);
offset += 8;
const cumulativeSpotFees = readSignedBigInt64LE(buffer, offset);
offset += 8;
const cumulativePerpFunding = readSignedBigInt64LE(buffer, offset);
offset += 8;
const liquidationMarginFreed = readUnsignedBigInt64LE(buffer, offset);
offset += 8;
const lastActiveSlot = readUnsignedBigInt64LE(buffer, offset);
offset += 8;
const nextOrderId = buffer.readUInt32LE(offset);
offset += 4;
const maxMarginRatio = buffer.readUInt32LE(offset);
offset += 4;
const nextLiquidationId = buffer.readUInt16LE(offset);
offset += 2;
const subAccountId = buffer.readUInt16LE(offset);
offset += 2;
const status = buffer.readUInt8(offset);
offset += 1;
const isMarginTradingEnabled = buffer.readUInt8(offset) === 1;
offset += 1;
const idle = buffer.readUInt8(offset) === 1;
offset += 1;
const openOrders = buffer.readUInt8(offset);
offset += 1;
const hasOpenOrder = buffer.readUInt8(offset) === 1;
offset += 1;
const openAuctions = buffer.readUInt8(offset);
offset += 1;
const hasOpenAuction = buffer.readUInt8(offset) === 1;
offset += 1;
let marginMode: MarginMode;
const marginModeNum = buffer.readUInt8(offset);
if (marginModeNum === 0) {
marginMode = MarginMode.DEFAULT;
} else {
marginMode = MarginMode.HIGH_LEVERAGE;
}
offset += 1;
// @ts-ignore
return {
authority,
delegate,
name,
spotPositions,
perpPositions,
orders,
lastAddPerpLpSharesTs,
totalDeposits,
totalWithdraws,
totalSocialLoss,
settledPerpPnl,
cumulativeSpotFees,
cumulativePerpFunding,
liquidationMarginFreed,
lastActiveSlot,
nextOrderId,
maxMarginRatio,
nextLiquidationId,
subAccountId,
status,
isMarginTradingEnabled,
idle,
openOrders,
hasOpenOrder,
openAuctions,
hasOpenAuction,
marginMode,
};
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/pollingInsuranceFundStakeAccountSubscriber.ts
|
import {
DataAndSlot,
NotSubscribedError,
InsuranceFundStakeAccountEvents,
InsuranceFundStakeAccountSubscriber,
} from './types';
import { Program } from '@coral-xyz/anchor';
import StrictEventEmitter from 'strict-event-emitter-types';
import { EventEmitter } from 'events';
import { PublicKey } from '@solana/web3.js';
import { BulkAccountLoader } from './bulkAccountLoader';
import { InsuranceFundStake } from '../types';
export class PollingInsuranceFundStakeAccountSubscriber
implements InsuranceFundStakeAccountSubscriber
{
isSubscribed: boolean;
program: Program;
eventEmitter: StrictEventEmitter<
EventEmitter,
InsuranceFundStakeAccountEvents
>;
insuranceFundStakeAccountPublicKey: PublicKey;
accountLoader: BulkAccountLoader;
callbackId?: string;
errorCallbackId?: string;
insuranceFundStakeAccountAndSlot?: DataAndSlot<InsuranceFundStake>;
public constructor(
program: Program,
publicKey: PublicKey,
accountLoader: BulkAccountLoader
) {
this.isSubscribed = false;
this.program = program;
this.insuranceFundStakeAccountPublicKey = publicKey;
this.accountLoader = accountLoader;
this.eventEmitter = new EventEmitter();
}
async subscribe(insuranceFundStake?: InsuranceFundStake): Promise<boolean> {
if (this.isSubscribed) {
return true;
}
if (insuranceFundStake) {
this.insuranceFundStakeAccountAndSlot = {
data: insuranceFundStake,
slot: undefined,
};
}
await this.addToAccountLoader();
if (this.doesAccountExist()) {
this.eventEmitter.emit('update');
}
this.isSubscribed = true;
return true;
}
async addToAccountLoader(): Promise<void> {
if (this.callbackId) {
return;
}
this.callbackId = await this.accountLoader.addAccount(
this.insuranceFundStakeAccountPublicKey,
(buffer, slot: number) => {
if (!buffer) {
return;
}
if (
this.insuranceFundStakeAccountAndSlot &&
this.insuranceFundStakeAccountAndSlot.slot > slot
) {
return;
}
const account = this.program.account.user.coder.accounts.decode(
'InsuranceFundStake',
buffer
);
this.insuranceFundStakeAccountAndSlot = { data: account, slot };
this.eventEmitter.emit('insuranceFundStakeAccountUpdate', account);
this.eventEmitter.emit('update');
}
);
this.errorCallbackId = this.accountLoader.addErrorCallbacks((error) => {
this.eventEmitter.emit('error', error);
});
}
async fetchIfUnloaded(): Promise<void> {
if (this.insuranceFundStakeAccountAndSlot === undefined) {
await this.fetch();
}
}
async fetch(): Promise<void> {
try {
const dataAndContext =
await this.program.account.insuranceFundStake.fetchAndContext(
this.insuranceFundStakeAccountPublicKey,
this.accountLoader.commitment
);
if (
dataAndContext.context.slot >
(this.insuranceFundStakeAccountAndSlot?.slot ?? 0)
) {
this.insuranceFundStakeAccountAndSlot = {
data: dataAndContext.data as InsuranceFundStake,
slot: dataAndContext.context.slot,
};
}
} catch (e) {
console.log(
`PollingInsuranceFundStakeAccountSubscriber.fetch() InsuranceFundStake does not exist: ${e.message}`
);
}
}
doesAccountExist(): boolean {
return this.insuranceFundStakeAccountAndSlot !== undefined;
}
async unsubscribe(): Promise<void> {
if (!this.isSubscribed) {
return;
}
this.accountLoader.removeAccount(
this.insuranceFundStakeAccountPublicKey,
this.callbackId
);
this.callbackId = undefined;
this.accountLoader.removeErrorCallbacks(this.errorCallbackId);
this.errorCallbackId = undefined;
this.isSubscribed = false;
}
assertIsSubscribed(): void {
if (!this.isSubscribed) {
throw new NotSubscribedError(
'You must call `subscribe` before using this function'
);
}
}
public getInsuranceFundStakeAccountAndSlot(): DataAndSlot<InsuranceFundStake> {
this.assertIsSubscribed();
return this.insuranceFundStakeAccountAndSlot;
}
didSubscriptionSucceed(): boolean {
return !!this.insuranceFundStakeAccountAndSlot;
}
public updateData(
insuranceFundStake: InsuranceFundStake,
slot: number
): void {
if (
!this.insuranceFundStakeAccountAndSlot ||
this.insuranceFundStakeAccountAndSlot.slot < slot
) {
this.insuranceFundStakeAccountAndSlot = {
data: insuranceFundStake,
slot,
};
this.eventEmitter.emit(
'insuranceFundStakeAccountUpdate',
insuranceFundStake
);
this.eventEmitter.emit('update');
}
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/basicUserAccountSubscriber.ts
|
import { DataAndSlot, UserAccountEvents, UserAccountSubscriber } from './types';
import { PublicKey } from '@solana/web3.js';
import StrictEventEmitter from 'strict-event-emitter-types';
import { EventEmitter } from 'events';
import { UserAccount } from '../types';
/**
* Basic implementation of UserAccountSubscriber. It will only take in UserAccount
* data during initialization and will not fetch or subscribe to updates.
*/
export class BasicUserAccountSubscriber implements UserAccountSubscriber {
isSubscribed: boolean;
eventEmitter: StrictEventEmitter<EventEmitter, UserAccountEvents>;
userAccountPublicKey: PublicKey;
callbackId?: string;
errorCallbackId?: string;
user: DataAndSlot<UserAccount>;
public constructor(
userAccountPublicKey: PublicKey,
data?: UserAccount,
slot?: number
) {
this.isSubscribed = true;
this.eventEmitter = new EventEmitter();
this.userAccountPublicKey = userAccountPublicKey;
this.user = { data, slot };
}
async subscribe(_userAccount?: UserAccount): Promise<boolean> {
return true;
}
async addToAccountLoader(): Promise<void> {}
async fetch(): Promise<void> {}
doesAccountExist(): boolean {
return this.user !== undefined;
}
async unsubscribe(): Promise<void> {}
assertIsSubscribed(): void {}
public getUserAccountAndSlot(): DataAndSlot<UserAccount> {
return this.user;
}
public updateData(userAccount: UserAccount, slot: number): void {
if (!this.user || slot >= (this.user.slot ?? 0)) {
this.user = { data: userAccount, slot };
this.eventEmitter.emit('userAccountUpdate', userAccount);
this.eventEmitter.emit('update');
}
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/pollingUserStatsAccountSubscriber.ts
|
import {
DataAndSlot,
NotSubscribedError,
UserStatsAccountSubscriber,
UserStatsAccountEvents,
} from './types';
import { Program } from '@coral-xyz/anchor';
import StrictEventEmitter from 'strict-event-emitter-types';
import { EventEmitter } from 'events';
import { PublicKey } from '@solana/web3.js';
import { UserStatsAccount } from '../types';
import { BulkAccountLoader } from './bulkAccountLoader';
export class PollingUserStatsAccountSubscriber
implements UserStatsAccountSubscriber
{
isSubscribed: boolean;
program: Program;
eventEmitter: StrictEventEmitter<EventEmitter, UserStatsAccountEvents>;
userStatsAccountPublicKey: PublicKey;
accountLoader: BulkAccountLoader;
callbackId?: string;
errorCallbackId?: string;
userStats?: DataAndSlot<UserStatsAccount>;
public constructor(
program: Program,
userStatsAccountPublicKey: PublicKey,
accountLoader: BulkAccountLoader
) {
this.isSubscribed = false;
this.program = program;
this.accountLoader = accountLoader;
this.eventEmitter = new EventEmitter();
this.userStatsAccountPublicKey = userStatsAccountPublicKey;
}
async subscribe(userStatsAccount?: UserStatsAccount): Promise<boolean> {
if (this.isSubscribed) {
return true;
}
if (userStatsAccount) {
this.userStats = { data: userStatsAccount, slot: undefined };
}
await this.addToAccountLoader();
await this.fetchIfUnloaded();
if (this.doesAccountExist()) {
this.eventEmitter.emit('update');
}
this.isSubscribed = true;
return true;
}
async addToAccountLoader(): Promise<void> {
if (this.callbackId !== undefined) {
return;
}
this.callbackId = await this.accountLoader.addAccount(
this.userStatsAccountPublicKey,
(buffer, slot: number) => {
if (!buffer) {
return;
}
if (this.userStats && this.userStats.slot > slot) {
return;
}
const account =
this.program.account.userStats.coder.accounts.decodeUnchecked(
'UserStats',
buffer
);
this.userStats = { data: account, slot };
this.eventEmitter.emit('userStatsAccountUpdate', account);
this.eventEmitter.emit('update');
}
);
this.errorCallbackId = this.accountLoader.addErrorCallbacks((error) => {
this.eventEmitter.emit('error', error);
});
}
async fetchIfUnloaded(): Promise<void> {
if (this.userStats === undefined) {
await this.fetch();
}
}
async fetch(): Promise<void> {
try {
const dataAndContext =
await this.program.account.userStats.fetchAndContext(
this.userStatsAccountPublicKey,
this.accountLoader.commitment
);
if (dataAndContext.context.slot > (this.userStats?.slot ?? 0)) {
this.userStats = {
data: dataAndContext.data as UserStatsAccount,
slot: dataAndContext.context.slot,
};
}
} catch (e) {
console.log(
`PollingUserStatsAccountSubscriber.fetch() UserStatsAccount does not exist: ${e.message}`
);
}
}
doesAccountExist(): boolean {
return this.userStats !== undefined;
}
async unsubscribe(): Promise<void> {
if (!this.isSubscribed) {
return;
}
this.accountLoader.removeAccount(
this.userStatsAccountPublicKey,
this.callbackId
);
this.callbackId = undefined;
this.accountLoader.removeErrorCallbacks(this.errorCallbackId);
this.errorCallbackId = undefined;
this.isSubscribed = false;
}
assertIsSubscribed(): void {
if (!this.isSubscribed) {
throw new NotSubscribedError(
'You must call `subscribe` before using this function'
);
}
}
public getUserStatsAccountAndSlot(): DataAndSlot<UserStatsAccount> {
if (!this.doesAccountExist()) {
throw new NotSubscribedError(
'You must call `subscribe` or `fetch` before using this function'
);
}
return this.userStats;
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/bulkAccountLoader.ts
|
import { Commitment, PublicKey } from '@solana/web3.js';
import { v4 as uuidv4 } from 'uuid';
import { BufferAndSlot } from './types';
import { promiseTimeout } from '../util/promiseTimeout';
import { Connection } from '../bankrun/bankrunConnection';
export type AccountToLoad = {
publicKey: PublicKey;
callbacks: Map<string, (buffer: Buffer, slot: number) => void>;
};
const GET_MULTIPLE_ACCOUNTS_CHUNK_SIZE = 99;
const oneMinute = 60 * 1000;
export class BulkAccountLoader {
connection: Connection;
commitment: Commitment;
pollingFrequency: number;
accountsToLoad = new Map<string, AccountToLoad>();
bufferAndSlotMap = new Map<string, BufferAndSlot>();
errorCallbacks = new Map<string, (e) => void>();
intervalId?: ReturnType<typeof setTimeout>;
// to handle clients spamming load
loadPromise?: Promise<void>;
loadPromiseResolver: () => void;
lastTimeLoadingPromiseCleared = Date.now();
mostRecentSlot = 0;
public constructor(
connection: Connection,
commitment: Commitment,
pollingFrequency: number
) {
this.connection = connection;
this.commitment = commitment;
this.pollingFrequency = pollingFrequency;
}
public async addAccount(
publicKey: PublicKey,
callback: (buffer: Buffer, slot: number) => void
): Promise<string> {
if (!publicKey) {
console.trace(`Caught adding blank publickey to bulkAccountLoader`);
}
const existingSize = this.accountsToLoad.size;
const callbackId = uuidv4();
const existingAccountToLoad = this.accountsToLoad.get(publicKey.toString());
if (existingAccountToLoad) {
existingAccountToLoad.callbacks.set(callbackId, callback);
} else {
const callbacks = new Map<
string,
(buffer: Buffer, slot: number) => void
>();
callbacks.set(callbackId, callback);
const newAccountToLoad = {
publicKey,
callbacks,
};
this.accountsToLoad.set(publicKey.toString(), newAccountToLoad);
}
if (existingSize === 0) {
this.startPolling();
}
// resolve the current loadPromise in case client wants to call load
await this.loadPromise;
return callbackId;
}
public removeAccount(publicKey: PublicKey, callbackId: string): void {
const existingAccountToLoad = this.accountsToLoad.get(publicKey.toString());
if (existingAccountToLoad) {
existingAccountToLoad.callbacks.delete(callbackId);
if (existingAccountToLoad.callbacks.size === 0) {
this.bufferAndSlotMap.delete(publicKey.toString());
this.accountsToLoad.delete(existingAccountToLoad.publicKey.toString());
}
}
if (this.accountsToLoad.size === 0) {
this.stopPolling();
}
}
public addErrorCallbacks(callback: (error: Error) => void): string {
const callbackId = uuidv4();
this.errorCallbacks.set(callbackId, callback);
return callbackId;
}
public removeErrorCallbacks(callbackId: string): void {
this.errorCallbacks.delete(callbackId);
}
chunks<T>(array: readonly T[], size: number): T[][] {
return new Array(Math.ceil(array.length / size))
.fill(null)
.map((_, index) => index * size)
.map((begin) => array.slice(begin, begin + size));
}
public async load(): Promise<void> {
if (this.loadPromise) {
const now = Date.now();
if (now - this.lastTimeLoadingPromiseCleared > oneMinute) {
this.loadPromise = undefined;
} else {
return this.loadPromise;
}
}
this.loadPromise = new Promise((resolver) => {
this.loadPromiseResolver = resolver;
});
this.lastTimeLoadingPromiseCleared = Date.now();
try {
const chunks = this.chunks(
this.chunks(
Array.from(this.accountsToLoad.values()),
GET_MULTIPLE_ACCOUNTS_CHUNK_SIZE
),
10
);
await Promise.all(
chunks.map((chunk) => {
return this.loadChunk(chunk);
})
);
} catch (e) {
console.error(`Error in bulkAccountLoader.load()`);
console.error(e);
for (const [_, callback] of this.errorCallbacks) {
callback(e);
}
} finally {
this.loadPromiseResolver();
this.loadPromise = undefined;
}
}
async loadChunk(accountsToLoadChunks: AccountToLoad[][]): Promise<void> {
if (accountsToLoadChunks.length === 0) {
return;
}
const requests = new Array<{ methodName: string; args: any }>();
for (const accountsToLoadChunk of accountsToLoadChunks) {
const args = [
accountsToLoadChunk
.filter((accountToLoad) => accountToLoad.callbacks.size > 0)
.map((accountToLoad) => {
return accountToLoad.publicKey.toBase58();
}),
{ commitment: this.commitment },
];
requests.push({
methodName: 'getMultipleAccounts',
args,
});
}
const rpcResponses: any | null = await promiseTimeout(
// @ts-ignore
this.connection._rpcBatchRequest(requests),
10 * 1000 // 30 second timeout
);
if (rpcResponses === null) {
this.log('request to rpc timed out');
return;
}
rpcResponses.forEach((rpcResponse, i) => {
if (!rpcResponse.result) {
console.error('rpc response missing result:');
console.log(JSON.stringify(rpcResponse));
return;
}
const newSlot = rpcResponse.result.context.slot;
if (newSlot > this.mostRecentSlot) {
this.mostRecentSlot = newSlot;
}
const accountsToLoad = accountsToLoadChunks[i];
accountsToLoad.forEach((accountToLoad, j) => {
if (accountToLoad.callbacks.size === 0) {
return;
}
const key = accountToLoad.publicKey.toBase58();
const oldRPCResponse = this.bufferAndSlotMap.get(key);
if (oldRPCResponse && newSlot < oldRPCResponse.slot) {
return;
}
let newBuffer: Buffer | undefined = undefined;
if (rpcResponse.result.value[j]) {
const raw: string = rpcResponse.result.value[j].data[0];
const dataType = rpcResponse.result.value[j].data[1];
newBuffer = Buffer.from(raw, dataType);
}
if (!oldRPCResponse) {
this.bufferAndSlotMap.set(key, {
slot: newSlot,
buffer: newBuffer,
});
this.handleAccountCallbacks(accountToLoad, newBuffer, newSlot);
return;
}
const oldBuffer = oldRPCResponse.buffer;
if (newBuffer && (!oldBuffer || !newBuffer.equals(oldBuffer))) {
this.bufferAndSlotMap.set(key, {
slot: newSlot,
buffer: newBuffer,
});
this.handleAccountCallbacks(accountToLoad, newBuffer, newSlot);
}
});
});
}
handleAccountCallbacks(
accountToLoad: AccountToLoad,
buffer: Buffer,
slot: number
): void {
for (const [_, callback] of accountToLoad.callbacks) {
try {
callback(buffer, slot);
} catch (e) {
console.log('Bulk account load: error in account callback');
console.log('accounto to load', accountToLoad.publicKey.toString());
console.log('buffer', buffer.toString('base64'));
for (const callback of accountToLoad.callbacks.values()) {
console.log('account to load cb', callback);
}
throw e;
}
}
}
public getBufferAndSlot(publicKey: PublicKey): BufferAndSlot | undefined {
return this.bufferAndSlotMap.get(publicKey.toString());
}
public getSlot(): number {
return this.mostRecentSlot;
}
public startPolling(): void {
if (this.intervalId) {
return;
}
if (this.pollingFrequency !== 0)
this.intervalId = setInterval(
this.load.bind(this),
this.pollingFrequency
);
}
public stopPolling(): void {
if (this.intervalId) {
clearInterval(this.intervalId);
this.intervalId = undefined;
}
}
public log(msg: string): void {
console.log(msg);
}
public updatePollingFrequency(pollingFrequency: number): void {
this.stopPolling();
this.pollingFrequency = pollingFrequency;
if (this.accountsToLoad.size > 0) {
this.startPolling();
}
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/bulkUserStatsSubscription.ts
|
import { UserStats } from '../userStats';
import { BulkAccountLoader } from './bulkAccountLoader';
import { PollingUserStatsAccountSubscriber } from './pollingUserStatsAccountSubscriber';
/**
* @param userStats
* @param accountLoader
*/
export async function bulkPollingUserStatsSubscribe(
userStats: UserStats[],
accountLoader: BulkAccountLoader
): Promise<void> {
if (userStats.length === 0) {
await accountLoader.load();
return;
}
await Promise.all(
userStats.map((userStat) => {
return (
userStat.accountSubscriber as PollingUserStatsAccountSubscriber
).addToAccountLoader();
})
);
await accountLoader.load();
await Promise.all(
userStats.map(async (userStat) => {
return userStat.subscribe();
})
);
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/grpcAccountSubscriber.ts
|
import { ResubOpts, GrpcConfigs } from './types';
import { Program } from '@coral-xyz/anchor';
import { PublicKey } from '@solana/web3.js';
import * as Buffer from 'buffer';
import { WebSocketAccountSubscriber } from './webSocketAccountSubscriber';
import {
Client,
ClientDuplexStream,
CommitmentLevel,
createClient,
SubscribeRequest,
SubscribeUpdate,
} from '../isomorphic/grpc';
export class grpcAccountSubscriber<T> extends WebSocketAccountSubscriber<T> {
client: Client;
stream: ClientDuplexStream<SubscribeRequest, SubscribeUpdate>;
commitmentLevel: CommitmentLevel;
listenerId?: number;
public constructor(
grpcConfigs: GrpcConfigs,
accountName: string,
program: Program,
accountPublicKey: PublicKey,
decodeBuffer?: (buffer: Buffer) => T,
resubOpts?: ResubOpts
) {
super(accountName, program, accountPublicKey, decodeBuffer, resubOpts);
this.client = createClient(
grpcConfigs.endpoint,
grpcConfigs.token,
grpcConfigs.channelOptions ?? {}
);
this.commitmentLevel =
// @ts-ignore :: isomorphic exported enum fails typescript but will work at runtime
grpcConfigs.commitmentLevel ?? CommitmentLevel.CONFIRMED;
}
override async subscribe(onChange: (data: T) => void): Promise<void> {
if (this.listenerId != null || this.isUnsubscribing) {
return;
}
this.onChange = onChange;
if (!this.dataAndSlot) {
await this.fetch();
}
// Subscribe with grpc
this.stream = await this.client.subscribe();
const request: SubscribeRequest = {
slots: {},
accounts: {
account: {
account: [this.accountPublicKey.toString()],
owner: [],
filters: [],
},
},
transactions: {},
blocks: {},
blocksMeta: {},
accountsDataSlice: [],
commitment: this.commitmentLevel,
entry: {},
transactionsStatus: {},
};
this.stream.on('data', (chunk: SubscribeUpdate) => {
if (!chunk.account) {
return;
}
const slot = Number(chunk.account.slot);
const accountInfo = {
owner: new PublicKey(chunk.account.account.owner),
lamports: Number(chunk.account.account.lamports),
data: Buffer.Buffer.from(chunk.account.account.data),
executable: chunk.account.account.executable,
rentEpoch: Number(chunk.account.account.rentEpoch),
};
if (this.resubOpts?.resubTimeoutMs) {
this.receivingData = true;
clearTimeout(this.timeoutId);
this.handleRpcResponse(
{
slot,
},
accountInfo
);
this.setTimeout();
} else {
this.handleRpcResponse(
{
slot,
},
accountInfo
);
}
});
return new Promise<void>((resolve, reject) => {
this.stream.write(request, (err) => {
if (err === null || err === undefined) {
this.listenerId = 1;
if (this.resubOpts?.resubTimeoutMs) {
this.receivingData = true;
this.setTimeout();
}
resolve();
} else {
reject(err);
}
});
}).catch((reason) => {
console.error(reason);
throw reason;
});
}
override async unsubscribe(onResub = false): Promise<void> {
if (!onResub && this.resubOpts) {
this.resubOpts.resubTimeoutMs = undefined;
}
this.isUnsubscribing = true;
clearTimeout(this.timeoutId);
this.timeoutId = undefined;
if (this.listenerId != null) {
const promise = new Promise<void>((resolve, reject) => {
const request: SubscribeRequest = {
slots: {},
accounts: {},
transactions: {},
blocks: {},
blocksMeta: {},
accountsDataSlice: [],
entry: {},
transactionsStatus: {},
};
this.stream.write(request, (err) => {
if (err === null || err === undefined) {
this.listenerId = undefined;
this.isUnsubscribing = false;
resolve();
} else {
reject(err);
}
});
}).catch((reason) => {
console.error(reason);
throw reason;
});
return promise;
} else {
this.isUnsubscribing = false;
}
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/grpcProgramAccountSubscriber.ts
|
import { ResubOpts, GrpcConfigs } from './types';
import { Program } from '@coral-xyz/anchor';
import bs58 from 'bs58';
import { Context, MemcmpFilter, PublicKey } from '@solana/web3.js';
import * as Buffer from 'buffer';
import { WebSocketProgramAccountSubscriber } from './webSocketProgramAccountSubscriber';
import {
Client,
ClientDuplexStream,
CommitmentLevel,
createClient,
SubscribeRequest,
SubscribeUpdate,
} from '../isomorphic/grpc';
export class grpcProgramAccountSubscriber<
T,
> extends WebSocketProgramAccountSubscriber<T> {
client: Client;
stream: ClientDuplexStream<SubscribeRequest, SubscribeUpdate>;
commitmentLevel: CommitmentLevel;
listenerId?: number;
public constructor(
grpcConfigs: GrpcConfigs,
subscriptionName: string,
accountDiscriminator: string,
program: Program,
decodeBufferFn: (accountName: string, ix: Buffer) => T,
options: { filters: MemcmpFilter[] } = {
filters: [],
},
resubOpts?: ResubOpts
) {
super(
subscriptionName,
accountDiscriminator,
program,
decodeBufferFn,
options,
resubOpts
);
this.client = createClient(
grpcConfigs.endpoint,
grpcConfigs.token,
grpcConfigs.channelOptions ?? {}
);
this.commitmentLevel =
// @ts-ignore :: isomorphic exported enum fails typescript but will work at runtime
grpcConfigs.commitmentLevel ?? CommitmentLevel.CONFIRMED;
}
async subscribe(
onChange: (
accountId: PublicKey,
data: T,
context: Context,
buffer: Buffer
) => void
): Promise<void> {
if (this.listenerId != null || this.isUnsubscribing) {
return;
}
this.onChange = onChange;
// Subscribe with grpc
this.stream = await this.client.subscribe();
const filters = this.options.filters.map((filter) => {
return {
memcmp: {
offset: filter.memcmp.offset.toString(),
bytes: bs58.decode(filter.memcmp.bytes),
},
};
});
const request: SubscribeRequest = {
slots: {},
accounts: {
drift: {
account: [],
owner: [this.program.programId.toBase58()],
filters,
},
},
transactions: {},
blocks: {},
blocksMeta: {},
accountsDataSlice: [],
commitment: this.commitmentLevel,
entry: {},
transactionsStatus: {},
};
this.stream.on('data', (chunk: SubscribeUpdate) => {
if (!chunk.account) {
return;
}
const slot = Number(chunk.account.slot);
const accountInfo = {
owner: new PublicKey(chunk.account.account.owner),
lamports: Number(chunk.account.account.lamports),
data: Buffer.Buffer.from(chunk.account.account.data),
executable: chunk.account.account.executable,
rentEpoch: Number(chunk.account.account.rentEpoch),
};
if (this.resubOpts?.resubTimeoutMs) {
this.receivingData = true;
clearTimeout(this.timeoutId);
this.handleRpcResponse(
{
slot,
},
{
accountId: new PublicKey(chunk.account.account.pubkey),
accountInfo,
}
);
this.setTimeout();
} else {
this.handleRpcResponse(
{
slot,
},
{
accountId: new PublicKey(chunk.account.account.pubkey),
accountInfo,
}
);
}
});
return new Promise<void>((resolve, reject) => {
this.stream.write(request, (err) => {
if (err === null || err === undefined) {
this.listenerId = 1;
if (this.resubOpts?.resubTimeoutMs) {
this.receivingData = true;
this.setTimeout();
}
resolve();
} else {
reject(err);
}
});
}).catch((reason) => {
console.error(reason);
throw reason;
});
}
public async unsubscribe(onResub = false): Promise<void> {
if (!onResub && this.resubOpts) {
this.resubOpts.resubTimeoutMs = undefined;
}
this.isUnsubscribing = true;
clearTimeout(this.timeoutId);
this.timeoutId = undefined;
if (this.listenerId != null) {
const promise = new Promise<void>((resolve, reject) => {
const request: SubscribeRequest = {
slots: {},
accounts: {},
transactions: {},
blocks: {},
blocksMeta: {},
accountsDataSlice: [],
entry: {},
transactionsStatus: {},
};
this.stream.write(request, (err) => {
if (err === null || err === undefined) {
this.listenerId = undefined;
this.isUnsubscribing = false;
resolve();
} else {
reject(err);
}
});
}).catch((reason) => {
console.error(reason);
throw reason;
});
return promise;
} else {
this.isUnsubscribing = false;
}
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/grpcUserStatsAccountSubscriber.ts
|
import { ResubOpts, GrpcConfigs } from './types';
import { Program } from '@coral-xyz/anchor';
import { PublicKey } from '@solana/web3.js';
import { UserStatsAccount } from '../types';
import { WebSocketUserStatsAccountSubscriber } from './webSocketUserStatsAccountSubsriber';
import { grpcAccountSubscriber } from './grpcAccountSubscriber';
export class grpcUserStatsAccountSubscriber extends WebSocketUserStatsAccountSubscriber {
private grpcConfigs: GrpcConfigs;
public constructor(
grpcConfigs: GrpcConfigs,
program: Program,
userStatsAccountPublicKey: PublicKey,
resubOpts?: ResubOpts
) {
super(program, userStatsAccountPublicKey, resubOpts);
this.grpcConfigs = grpcConfigs;
}
async subscribe(userStatsAccount?: UserStatsAccount): Promise<boolean> {
if (this.isSubscribed) {
return true;
}
this.userStatsAccountSubscriber = new grpcAccountSubscriber(
this.grpcConfigs,
'userStats',
this.program,
this.userStatsAccountPublicKey,
undefined,
this.resubOpts
);
if (userStatsAccount) {
this.userStatsAccountSubscriber.setData(userStatsAccount);
}
await this.userStatsAccountSubscriber.subscribe(
(data: UserStatsAccount) => {
this.eventEmitter.emit('userStatsAccountUpdate', data);
this.eventEmitter.emit('update');
}
);
this.eventEmitter.emit('update');
this.isSubscribed = true;
return true;
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/utils.ts
|
import { DataAndSlot } from './types';
import { isVariant, PerpMarketAccount, SpotMarketAccount } from '../types';
import { OracleInfo } from '../oracles/types';
import { getOracleId } from '../oracles/oracleId';
export function capitalize(value: string): string {
return value[0].toUpperCase() + value.slice(1);
}
export function findDelistedPerpMarketsAndOracles(
perpMarkets: DataAndSlot<PerpMarketAccount>[],
spotMarkets: DataAndSlot<SpotMarketAccount>[]
): { perpMarketIndexes: number[]; oracles: OracleInfo[] } {
const delistedPerpMarketIndexes = [];
const delistedOracles: OracleInfo[] = [];
for (const perpMarket of perpMarkets) {
if (!perpMarket.data) {
continue;
}
if (isVariant(perpMarket.data.status, 'delisted')) {
delistedPerpMarketIndexes.push(perpMarket.data.marketIndex);
delistedOracles.push({
publicKey: perpMarket.data.amm.oracle,
source: perpMarket.data.amm.oracleSource,
});
}
}
// make sure oracle isn't used by spot market
const filteredDelistedOracles = [];
for (const delistedOracle of delistedOracles) {
let isUsedBySpotMarket = false;
for (const spotMarket of spotMarkets) {
if (!spotMarket.data) {
continue;
}
const delistedOracleId = getOracleId(
delistedOracle.publicKey,
delistedOracle.source
);
const spotMarketOracleId = getOracleId(
spotMarket.data.oracle,
spotMarket.data.oracleSource
);
if (spotMarketOracleId === delistedOracleId) {
isUsedBySpotMarket = true;
break;
}
}
if (!isUsedBySpotMarket) {
filteredDelistedOracles.push(delistedOracle);
}
}
return {
perpMarketIndexes: delistedPerpMarketIndexes,
oracles: filteredDelistedOracles,
};
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/grpcInsuranceFundStakeAccountSubscriber.ts
|
import { GrpcConfigs } from './types';
import { Program } from '@coral-xyz/anchor';
import { PublicKey } from '@solana/web3.js';
import { InsuranceFundStake } from '../types';
import { WebSocketInsuranceFundStakeAccountSubscriber } from './webSocketInsuranceFundStakeAccountSubscriber';
import { grpcAccountSubscriber } from './grpcAccountSubscriber';
export class grpcInsuranceFundStakeAccountSubscriber extends WebSocketInsuranceFundStakeAccountSubscriber {
private grpcConfigs: GrpcConfigs;
public constructor(
grpcConfigs: GrpcConfigs,
program: Program,
insuranceFundStakeAccountPublicKey: PublicKey,
resubTimeoutMs?: number
) {
super(program, insuranceFundStakeAccountPublicKey, resubTimeoutMs);
this.grpcConfigs = grpcConfigs;
}
async subscribe(
insuranceFundStakeAccount?: InsuranceFundStake
): Promise<boolean> {
if (this.isSubscribed) {
return true;
}
this.insuranceFundStakeDataAccountSubscriber = new grpcAccountSubscriber(
this.grpcConfigs,
'insuranceFundStake',
this.program,
this.insuranceFundStakeAccountPublicKey,
undefined,
{
resubTimeoutMs: this.resubTimeoutMs,
}
);
if (insuranceFundStakeAccount) {
this.insuranceFundStakeDataAccountSubscriber.setData(
insuranceFundStakeAccount
);
}
await this.insuranceFundStakeDataAccountSubscriber.subscribe(
(data: InsuranceFundStake) => {
this.eventEmitter.emit('insuranceFundStakeAccountUpdate', data);
this.eventEmitter.emit('update');
}
);
this.eventEmitter.emit('update');
this.isSubscribed = true;
return true;
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/pollingTokenAccountSubscriber.ts
|
import {
DataAndSlot,
NotSubscribedError,
TokenAccountEvents,
TokenAccountSubscriber,
} from './types';
import { Program } from '@coral-xyz/anchor';
import StrictEventEmitter from 'strict-event-emitter-types';
import { EventEmitter } from 'events';
import { PublicKey } from '@solana/web3.js';
import { BulkAccountLoader } from './bulkAccountLoader';
import { Account } from '@solana/spl-token';
import { parseTokenAccount } from '../token';
export class PollingTokenAccountSubscriber implements TokenAccountSubscriber {
isSubscribed: boolean;
program: Program;
eventEmitter: StrictEventEmitter<EventEmitter, TokenAccountEvents>;
publicKey: PublicKey;
accountLoader: BulkAccountLoader;
callbackId?: string;
errorCallbackId?: string;
tokenAccountAndSlot?: DataAndSlot<Account>;
public constructor(publicKey: PublicKey, accountLoader: BulkAccountLoader) {
this.isSubscribed = false;
this.publicKey = publicKey;
this.accountLoader = accountLoader;
this.eventEmitter = new EventEmitter();
}
async subscribe(): Promise<boolean> {
if (this.isSubscribed) {
return true;
}
await this.addToAccountLoader();
let subscriptionSucceeded = false;
let retries = 0;
while (!subscriptionSucceeded && retries < 5) {
await this.fetch();
subscriptionSucceeded = this.didSubscriptionSucceed();
retries++;
}
if (subscriptionSucceeded) {
this.eventEmitter.emit('update');
}
this.isSubscribed = subscriptionSucceeded;
return subscriptionSucceeded;
}
async addToAccountLoader(): Promise<void> {
if (this.callbackId) {
return;
}
this.callbackId = await this.accountLoader.addAccount(
this.publicKey,
(buffer, slot: number) => {
const tokenAccount = parseTokenAccount(buffer, this.publicKey);
this.tokenAccountAndSlot = { data: tokenAccount, slot };
// @ts-ignore
this.eventEmitter.emit('tokenAccountUpdate', tokenAccount);
this.eventEmitter.emit('update');
}
);
this.errorCallbackId = this.accountLoader.addErrorCallbacks((error) => {
this.eventEmitter.emit('error', error);
});
}
async fetch(): Promise<void> {
await this.accountLoader.load();
const { buffer, slot } = this.accountLoader.getBufferAndSlot(
this.publicKey
);
this.tokenAccountAndSlot = {
data: parseTokenAccount(buffer, this.publicKey),
slot,
};
}
async unsubscribe(): Promise<void> {
if (!this.isSubscribed) {
return;
}
this.accountLoader.removeAccount(this.publicKey, this.callbackId);
this.callbackId = undefined;
this.accountLoader.removeErrorCallbacks(this.errorCallbackId);
this.errorCallbackId = undefined;
this.isSubscribed = false;
}
assertIsSubscribed(): void {
if (!this.isSubscribed) {
throw new NotSubscribedError(
'You must call `subscribe` before using this function'
);
}
}
public getTokenAccountAndSlot(): DataAndSlot<Account> {
this.assertIsSubscribed();
return this.tokenAccountAndSlot;
}
didSubscriptionSucceed(): boolean {
return !!this.tokenAccountAndSlot;
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/pollingDriftClientAccountSubscriber.ts
|
import {
AccountToPoll,
DataAndSlot,
DelistedMarketSetting,
DriftClientAccountEvents,
DriftClientAccountSubscriber,
NotSubscribedError,
OraclesToPoll,
} from './types';
import { Program } from '@coral-xyz/anchor';
import StrictEventEmitter from 'strict-event-emitter-types';
import { EventEmitter } from 'events';
import {
PerpMarketAccount,
SpotMarketAccount,
StateAccount,
UserAccount,
OracleSource,
} from '../types';
import {
getDriftStateAccountPublicKey,
getPerpMarketPublicKey,
getSpotMarketPublicKey,
} from '../addresses/pda';
import { BulkAccountLoader } from './bulkAccountLoader';
import { capitalize, findDelistedPerpMarketsAndOracles } from './utils';
import { PublicKey } from '@solana/web3.js';
import { OracleInfo, OraclePriceData } from '../oracles/types';
import { OracleClientCache } from '../oracles/oracleClientCache';
import { QUOTE_ORACLE_PRICE_DATA } from '../oracles/quoteAssetOracleClient';
import { findAllMarketAndOracles } from '../config';
import { getOracleId } from '../oracles/oracleId';
const ORACLE_DEFAULT_ID = getOracleId(
PublicKey.default,
OracleSource.QUOTE_ASSET
);
export class PollingDriftClientAccountSubscriber
implements DriftClientAccountSubscriber
{
isSubscribed: boolean;
program: Program;
perpMarketIndexes: number[];
spotMarketIndexes: number[];
oracleInfos: OracleInfo[];
oracleClientCache = new OracleClientCache();
shouldFindAllMarketsAndOracles: boolean;
eventEmitter: StrictEventEmitter<EventEmitter, DriftClientAccountEvents>;
accountLoader: BulkAccountLoader;
accountsToPoll = new Map<string, AccountToPoll>();
oraclesToPoll = new Map<string, OraclesToPoll>();
errorCallbackId?: string;
state?: DataAndSlot<StateAccount>;
perpMarket = new Map<number, DataAndSlot<PerpMarketAccount>>();
perpOracleMap = new Map<number, PublicKey>();
perpOracleStringMap = new Map<number, string>();
spotMarket = new Map<number, DataAndSlot<SpotMarketAccount>>();
spotOracleMap = new Map<number, PublicKey>();
spotOracleStringMap = new Map<number, string>();
oracles = new Map<string, DataAndSlot<OraclePriceData>>();
user?: DataAndSlot<UserAccount>;
delistedMarketSetting: DelistedMarketSetting;
private isSubscribing = false;
private subscriptionPromise: Promise<boolean>;
private subscriptionPromiseResolver: (val: boolean) => void;
public constructor(
program: Program,
accountLoader: BulkAccountLoader,
perpMarketIndexes: number[],
spotMarketIndexes: number[],
oracleInfos: OracleInfo[],
shouldFindAllMarketsAndOracles: boolean,
delistedMarketSetting: DelistedMarketSetting
) {
this.isSubscribed = false;
this.program = program;
this.eventEmitter = new EventEmitter();
this.accountLoader = accountLoader;
this.perpMarketIndexes = perpMarketIndexes;
this.spotMarketIndexes = spotMarketIndexes;
this.oracleInfos = oracleInfos;
this.shouldFindAllMarketsAndOracles = shouldFindAllMarketsAndOracles;
this.delistedMarketSetting = delistedMarketSetting;
}
public async subscribe(): Promise<boolean> {
if (this.isSubscribed) {
return true;
}
if (this.isSubscribing) {
return await this.subscriptionPromise;
}
this.isSubscribing = true;
this.subscriptionPromise = new Promise((res) => {
this.subscriptionPromiseResolver = res;
});
if (this.shouldFindAllMarketsAndOracles) {
const { perpMarketIndexes, spotMarketIndexes, oracleInfos } =
await findAllMarketAndOracles(this.program);
this.perpMarketIndexes = perpMarketIndexes;
this.spotMarketIndexes = spotMarketIndexes;
this.oracleInfos = oracleInfos;
}
await this.updateAccountsToPoll();
this.updateOraclesToPoll();
await this.addToAccountLoader();
let subscriptionSucceeded = false;
let retries = 0;
while (!subscriptionSucceeded && retries < 5) {
await this.fetch();
subscriptionSucceeded = this.didSubscriptionSucceed();
retries++;
}
if (subscriptionSucceeded) {
this.eventEmitter.emit('update');
}
this.handleDelistedMarkets();
await Promise.all([this.setPerpOracleMap(), this.setSpotOracleMap()]);
this.isSubscribing = false;
this.isSubscribed = subscriptionSucceeded;
this.subscriptionPromiseResolver(subscriptionSucceeded);
return subscriptionSucceeded;
}
async updateAccountsToPoll(): Promise<void> {
if (this.accountsToPoll.size > 0) {
return;
}
const statePublicKey = await getDriftStateAccountPublicKey(
this.program.programId
);
this.accountsToPoll.set(statePublicKey.toString(), {
key: 'state',
publicKey: statePublicKey,
eventType: 'stateAccountUpdate',
});
await Promise.all([
this.updatePerpMarketAccountsToPoll(),
this.updateSpotMarketAccountsToPoll(),
]);
}
async updatePerpMarketAccountsToPoll(): Promise<boolean> {
await Promise.all(
this.perpMarketIndexes.map((marketIndex) => {
return this.addPerpMarketAccountToPoll(marketIndex);
})
);
return true;
}
async addPerpMarketAccountToPoll(marketIndex: number): Promise<boolean> {
const perpMarketPublicKey = await getPerpMarketPublicKey(
this.program.programId,
marketIndex
);
this.accountsToPoll.set(perpMarketPublicKey.toString(), {
key: 'perpMarket',
publicKey: perpMarketPublicKey,
eventType: 'perpMarketAccountUpdate',
mapKey: marketIndex,
});
return true;
}
async updateSpotMarketAccountsToPoll(): Promise<boolean> {
await Promise.all(
this.spotMarketIndexes.map(async (marketIndex) => {
await this.addSpotMarketAccountToPoll(marketIndex);
})
);
return true;
}
async addSpotMarketAccountToPoll(marketIndex: number): Promise<boolean> {
const marketPublicKey = await getSpotMarketPublicKey(
this.program.programId,
marketIndex
);
this.accountsToPoll.set(marketPublicKey.toString(), {
key: 'spotMarket',
publicKey: marketPublicKey,
eventType: 'spotMarketAccountUpdate',
mapKey: marketIndex,
});
return true;
}
updateOraclesToPoll(): boolean {
for (const oracleInfo of this.oracleInfos) {
if (!oracleInfo.publicKey.equals(PublicKey.default)) {
this.addOracleToPoll(oracleInfo);
}
}
return true;
}
addOracleToPoll(oracleInfo: OracleInfo): boolean {
this.oraclesToPoll.set(
getOracleId(oracleInfo.publicKey, oracleInfo.source),
{
publicKey: oracleInfo.publicKey,
source: oracleInfo.source,
}
);
return true;
}
async addToAccountLoader(): Promise<void> {
const accountPromises = [];
for (const [_, accountToPoll] of this.accountsToPoll) {
accountPromises.push(this.addAccountToAccountLoader(accountToPoll));
}
const oraclePromises = [];
for (const [_, oracleToPoll] of this.oraclesToPoll) {
oraclePromises.push(this.addOracleToAccountLoader(oracleToPoll));
}
await Promise.all([...accountPromises, ...oraclePromises]);
this.errorCallbackId = this.accountLoader.addErrorCallbacks((error) => {
this.eventEmitter.emit('error', error);
});
}
async addAccountToAccountLoader(accountToPoll: AccountToPoll): Promise<void> {
accountToPoll.callbackId = await this.accountLoader.addAccount(
accountToPoll.publicKey,
(buffer: Buffer, slot: number) => {
if (!buffer) return;
const account = this.program.account[
accountToPoll.key
].coder.accounts.decodeUnchecked(capitalize(accountToPoll.key), buffer);
const dataAndSlot = {
data: account,
slot,
};
if (accountToPoll.mapKey != undefined) {
this[accountToPoll.key].set(accountToPoll.mapKey, dataAndSlot);
} else {
this[accountToPoll.key] = dataAndSlot;
}
// @ts-ignore
this.eventEmitter.emit(accountToPoll.eventType, account);
this.eventEmitter.emit('update');
if (!this.isSubscribed) {
this.isSubscribed = this.didSubscriptionSucceed();
}
}
);
}
async addOracleToAccountLoader(oracleToPoll: OraclesToPoll): Promise<void> {
const oracleClient = this.oracleClientCache.get(
oracleToPoll.source,
this.program.provider.connection,
this.program
);
const oracleId = getOracleId(oracleToPoll.publicKey, oracleToPoll.source);
oracleToPoll.callbackId = await this.accountLoader.addAccount(
oracleToPoll.publicKey,
(buffer: Buffer, slot: number) => {
if (!buffer) return;
const oraclePriceData =
oracleClient.getOraclePriceDataFromBuffer(buffer);
const dataAndSlot = {
data: oraclePriceData,
slot,
};
this.oracles.set(oracleId, dataAndSlot);
this.eventEmitter.emit(
'oraclePriceUpdate',
oracleToPoll.publicKey,
oracleToPoll.source,
oraclePriceData
);
this.eventEmitter.emit('update');
}
);
}
public async fetch(): Promise<void> {
await this.accountLoader.load();
for (const [_, accountToPoll] of this.accountsToPoll) {
const bufferAndSlot = this.accountLoader.getBufferAndSlot(
accountToPoll.publicKey
);
if (!bufferAndSlot) {
continue;
}
const { buffer, slot } = bufferAndSlot;
if (buffer) {
const account = this.program.account[
accountToPoll.key
].coder.accounts.decodeUnchecked(capitalize(accountToPoll.key), buffer);
if (accountToPoll.mapKey != undefined) {
this[accountToPoll.key].set(accountToPoll.mapKey, {
data: account,
slot,
});
} else {
this[accountToPoll.key] = {
data: account,
slot,
};
}
}
}
for (const [_, oracleToPoll] of this.oraclesToPoll) {
const bufferAndSlot = this.accountLoader.getBufferAndSlot(
oracleToPoll.publicKey
);
if (!bufferAndSlot) {
continue;
}
const { buffer, slot } = bufferAndSlot;
if (buffer) {
const oracleClient = this.oracleClientCache.get(
oracleToPoll.source,
this.program.provider.connection,
this.program
);
const oraclePriceData =
oracleClient.getOraclePriceDataFromBuffer(buffer);
this.oracles.set(
getOracleId(oracleToPoll.publicKey, oracleToPoll.source),
{
data: oraclePriceData,
slot,
}
);
}
}
}
didSubscriptionSucceed(): boolean {
if (this.state) return true;
return false;
}
public async unsubscribe(): Promise<void> {
for (const [_, accountToPoll] of this.accountsToPoll) {
this.accountLoader.removeAccount(
accountToPoll.publicKey,
accountToPoll.callbackId
);
}
for (const [_, oracleToPoll] of this.oraclesToPoll) {
this.accountLoader.removeAccount(
oracleToPoll.publicKey,
oracleToPoll.callbackId
);
}
this.accountLoader.removeErrorCallbacks(this.errorCallbackId);
this.errorCallbackId = undefined;
this.accountsToPoll.clear();
this.oraclesToPoll.clear();
this.isSubscribed = false;
}
async addSpotMarket(marketIndex: number): Promise<boolean> {
const marketPublicKey = await getSpotMarketPublicKey(
this.program.programId,
marketIndex
);
if (this.accountsToPoll.has(marketPublicKey.toString())) {
return true;
}
await this.addSpotMarketAccountToPoll(marketIndex);
const accountToPoll = this.accountsToPoll.get(marketPublicKey.toString());
await this.addAccountToAccountLoader(accountToPoll);
this.setSpotOracleMap();
return true;
}
async addPerpMarket(marketIndex: number): Promise<boolean> {
const marketPublicKey = await getPerpMarketPublicKey(
this.program.programId,
marketIndex
);
if (this.accountsToPoll.has(marketPublicKey.toString())) {
return true;
}
await this.addPerpMarketAccountToPoll(marketIndex);
const accountToPoll = this.accountsToPoll.get(marketPublicKey.toString());
await this.addAccountToAccountLoader(accountToPoll);
await this.setPerpOracleMap();
return true;
}
async addOracle(oracleInfo: OracleInfo): Promise<boolean> {
const oracleId = getOracleId(oracleInfo.publicKey, oracleInfo.source);
if (
oracleInfo.publicKey.equals(PublicKey.default) ||
this.oracles.has(oracleId)
) {
return true;
}
// this func can be called multiple times before the first pauseForOracleToBeAdded finishes
// avoid adding to oraclesToPoll multiple time
if (!this.oraclesToPoll.has(oracleId)) {
this.addOracleToPoll(oracleInfo);
const oracleToPoll = this.oraclesToPoll.get(oracleId);
await this.addOracleToAccountLoader(oracleToPoll);
}
await this.pauseForOracleToBeAdded(3, oracleInfo.publicKey.toBase58());
return true;
}
private async pauseForOracleToBeAdded(
tries: number,
oracle: string
): Promise<void> {
let i = 0;
while (i < tries) {
await new Promise((r) =>
setTimeout(r, this.accountLoader.pollingFrequency)
);
if (this.accountLoader.bufferAndSlotMap.has(oracle)) {
return;
}
i++;
}
console.log(`Pausing to find oracle ${oracle} failed`);
}
async setPerpOracleMap() {
const perpMarkets = this.getMarketAccountsAndSlots();
const oraclePromises = [];
for (const perpMarket of perpMarkets) {
const perpMarketAccount = perpMarket.data;
const perpMarketIndex = perpMarketAccount.marketIndex;
const oracle = perpMarketAccount.amm.oracle;
const oracleId = getOracleId(oracle, perpMarketAccount.amm.oracleSource);
if (!this.oracles.has(oracleId)) {
oraclePromises.push(
this.addOracle({
publicKey: oracle,
source: perpMarketAccount.amm.oracleSource,
})
);
}
this.perpOracleMap.set(perpMarketIndex, oracle);
this.perpOracleStringMap.set(perpMarketIndex, oracleId);
}
await Promise.all(oraclePromises);
}
async setSpotOracleMap() {
const spotMarkets = this.getSpotMarketAccountsAndSlots();
const oraclePromises = [];
for (const spotMarket of spotMarkets) {
const spotMarketAccount = spotMarket.data;
const spotMarketIndex = spotMarketAccount.marketIndex;
const oracle = spotMarketAccount.oracle;
const oracleId = getOracleId(oracle, spotMarketAccount.oracleSource);
if (!this.oracles.has(oracleId)) {
oraclePromises.push(
this.addOracle({
publicKey: oracle,
source: spotMarketAccount.oracleSource,
})
);
}
this.spotOracleMap.set(spotMarketIndex, oracle);
this.spotOracleStringMap.set(spotMarketIndex, oracleId);
}
await Promise.all(oraclePromises);
}
handleDelistedMarkets(): void {
if (this.delistedMarketSetting === DelistedMarketSetting.Subscribe) {
return;
}
const { perpMarketIndexes, oracles } = findDelistedPerpMarketsAndOracles(
this.getMarketAccountsAndSlots(),
this.getSpotMarketAccountsAndSlots()
);
for (const perpMarketIndex of perpMarketIndexes) {
const perpMarketPubkey = this.perpMarket.get(perpMarketIndex).data.pubkey;
const callbackId = this.accountsToPoll.get(
perpMarketPubkey.toBase58()
).callbackId;
this.accountLoader.removeAccount(perpMarketPubkey, callbackId);
if (this.delistedMarketSetting === DelistedMarketSetting.Discard) {
this.perpMarket.delete(perpMarketIndex);
}
}
for (const oracle of oracles) {
const oracleId = getOracleId(oracle.publicKey, oracle.source);
const callbackId = this.oraclesToPoll.get(oracleId).callbackId;
this.accountLoader.removeAccount(oracle.publicKey, callbackId);
if (this.delistedMarketSetting === DelistedMarketSetting.Discard) {
this.oracles.delete(oracleId);
}
}
}
assertIsSubscribed(): void {
if (!this.isSubscribed) {
throw new NotSubscribedError(
'You must call `subscribe` before using this function'
);
}
}
public getStateAccountAndSlot(): DataAndSlot<StateAccount> {
this.assertIsSubscribed();
return this.state;
}
public getMarketAccountAndSlot(
marketIndex: number
): DataAndSlot<PerpMarketAccount> | undefined {
return this.perpMarket.get(marketIndex);
}
public getMarketAccountsAndSlots(): DataAndSlot<PerpMarketAccount>[] {
return Array.from(this.perpMarket.values());
}
public getSpotMarketAccountAndSlot(
marketIndex: number
): DataAndSlot<SpotMarketAccount> | undefined {
return this.spotMarket.get(marketIndex);
}
public getSpotMarketAccountsAndSlots(): DataAndSlot<SpotMarketAccount>[] {
return Array.from(this.spotMarket.values());
}
public getOraclePriceDataAndSlot(
oracleId: string
): DataAndSlot<OraclePriceData> | undefined {
this.assertIsSubscribed();
if (oracleId === ORACLE_DEFAULT_ID) {
return {
data: QUOTE_ORACLE_PRICE_DATA,
slot: 0,
};
}
return this.oracles.get(oracleId);
}
public getOraclePriceDataAndSlotForPerpMarket(
marketIndex: number
): DataAndSlot<OraclePriceData> | undefined {
const perpMarketAccount = this.getMarketAccountAndSlot(marketIndex);
const oracle = this.perpOracleMap.get(marketIndex);
const oracleId = this.perpOracleStringMap.get(marketIndex);
if (!perpMarketAccount || !oracle) {
return undefined;
}
if (!perpMarketAccount.data.amm.oracle.equals(oracle)) {
// If the oracle has changed, we need to update the oracle map in background
this.setPerpOracleMap();
}
return this.getOraclePriceDataAndSlot(oracleId);
}
public getOraclePriceDataAndSlotForSpotMarket(
marketIndex: number
): DataAndSlot<OraclePriceData> | undefined {
const spotMarketAccount = this.getSpotMarketAccountAndSlot(marketIndex);
const oracle = this.spotOracleMap.get(marketIndex);
const oracleId = this.spotOracleStringMap.get(marketIndex);
if (!spotMarketAccount || !oracle) {
return undefined;
}
if (!spotMarketAccount.data.oracle.equals(oracle)) {
// If the oracle has changed, we need to update the oracle map in background
this.setSpotOracleMap();
}
return this.getOraclePriceDataAndSlot(oracleId);
}
public updateAccountLoaderPollingFrequency(pollingFrequency: number): void {
this.accountLoader.updatePollingFrequency(pollingFrequency);
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/webSocketHighLeverageModeConfigAccountSubscriber.ts
|
import {
DataAndSlot,
AccountSubscriber,
NotSubscribedError,
HighLeverageModeConfigAccountEvents,
HighLeverageModeConfigAccountSubscriber,
} from './types';
import { Program } from '@coral-xyz/anchor';
import StrictEventEmitter from 'strict-event-emitter-types';
import { EventEmitter } from 'events';
import { Commitment, PublicKey } from '@solana/web3.js';
import { WebSocketAccountSubscriber } from './webSocketAccountSubscriber';
import { HighLeverageModeConfig } from '../types';
export class WebSocketHighLeverageModeConfigAccountSubscriber
implements HighLeverageModeConfigAccountSubscriber
{
isSubscribed: boolean;
resubTimeoutMs?: number;
commitment?: Commitment;
program: Program;
eventEmitter: StrictEventEmitter<
EventEmitter,
HighLeverageModeConfigAccountEvents
>;
highLeverageModeConfigAccountPublicKey: PublicKey;
highLeverageModeConfigDataAccountSubscriber: AccountSubscriber<HighLeverageModeConfig>;
public constructor(
program: Program,
highLeverageModeConfigAccountPublicKey: PublicKey,
resubTimeoutMs?: number,
commitment?: Commitment
) {
this.isSubscribed = false;
this.program = program;
this.highLeverageModeConfigAccountPublicKey =
highLeverageModeConfigAccountPublicKey;
this.eventEmitter = new EventEmitter();
this.resubTimeoutMs = resubTimeoutMs;
this.commitment = commitment;
}
async subscribe(
highLeverageModeConfigAccount?: HighLeverageModeConfig
): Promise<boolean> {
if (this.isSubscribed) {
return true;
}
this.highLeverageModeConfigDataAccountSubscriber =
new WebSocketAccountSubscriber(
'highLeverageModeConfig',
this.program,
this.highLeverageModeConfigAccountPublicKey,
undefined,
{
resubTimeoutMs: this.resubTimeoutMs,
},
this.commitment
);
if (highLeverageModeConfigAccount) {
this.highLeverageModeConfigDataAccountSubscriber.setData(
highLeverageModeConfigAccount
);
}
await this.highLeverageModeConfigDataAccountSubscriber.subscribe(
(data: HighLeverageModeConfig) => {
this.eventEmitter.emit('highLeverageModeConfigAccountUpdate', data);
this.eventEmitter.emit('update');
}
);
this.eventEmitter.emit('update');
this.isSubscribed = true;
return true;
}
async fetch(): Promise<void> {
await Promise.all([
this.highLeverageModeConfigDataAccountSubscriber.fetch(),
]);
}
async unsubscribe(): Promise<void> {
if (!this.isSubscribed) {
return;
}
await Promise.all([
this.highLeverageModeConfigDataAccountSubscriber.unsubscribe(),
]);
this.isSubscribed = false;
}
assertIsSubscribed(): void {
if (!this.isSubscribed) {
throw new NotSubscribedError(
'You must call `subscribe` before using this function'
);
}
}
public getHighLeverageModeConfigAccountAndSlot(): DataAndSlot<HighLeverageModeConfig> {
this.assertIsSubscribed();
return this.highLeverageModeConfigDataAccountSubscriber.dataAndSlot;
}
public updateData(
highLeverageModeConfig: HighLeverageModeConfig,
slot: number
): void {
const currentDataSlot =
this.highLeverageModeConfigDataAccountSubscriber.dataAndSlot?.slot || 0;
if (currentDataSlot <= slot) {
this.highLeverageModeConfigDataAccountSubscriber.setData(
highLeverageModeConfig,
slot
);
this.eventEmitter.emit(
'highLeverageModeConfigAccountUpdate',
highLeverageModeConfig
);
this.eventEmitter.emit('update');
}
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/webSocketProgramAccountSubscriber.ts
|
import { BufferAndSlot, ProgramAccountSubscriber, ResubOpts } from './types';
import { AnchorProvider, Program } from '@coral-xyz/anchor';
import {
Commitment,
Context,
KeyedAccountInfo,
MemcmpFilter,
PublicKey,
} from '@solana/web3.js';
import * as Buffer from 'buffer';
export class WebSocketProgramAccountSubscriber<T>
implements ProgramAccountSubscriber<T>
{
subscriptionName: string;
accountDiscriminator: string;
bufferAndSlot?: BufferAndSlot;
bufferAndSlotMap: Map<string, BufferAndSlot> = new Map();
program: Program;
decodeBuffer: (accountName: string, ix: Buffer) => T;
onChange: (
accountId: PublicKey,
data: T,
context: Context,
buffer: Buffer
) => void;
listenerId?: number;
resubOpts?: ResubOpts;
isUnsubscribing = false;
timeoutId?: NodeJS.Timeout;
options: { filters: MemcmpFilter[]; commitment?: Commitment };
receivingData = false;
public constructor(
subscriptionName: string,
accountDiscriminator: string,
program: Program,
decodeBufferFn: (accountName: string, ix: Buffer) => T,
options: { filters: MemcmpFilter[]; commitment?: Commitment } = {
filters: [],
},
resubOpts?: ResubOpts
) {
this.subscriptionName = subscriptionName;
this.accountDiscriminator = accountDiscriminator;
this.program = program;
this.decodeBuffer = decodeBufferFn;
this.resubOpts = resubOpts;
if (this.resubOpts?.resubTimeoutMs < 1000) {
console.log(
'resubTimeoutMs should be at least 1000ms to avoid spamming resub'
);
}
this.options = options;
this.receivingData = false;
}
async subscribe(
onChange: (
accountId: PublicKey,
data: T,
context: Context,
buffer: Buffer
) => void
): Promise<void> {
if (this.listenerId != null || this.isUnsubscribing) {
return;
}
this.onChange = onChange;
this.listenerId = this.program.provider.connection.onProgramAccountChange(
this.program.programId,
(keyedAccountInfo, context) => {
if (this.resubOpts?.resubTimeoutMs) {
this.receivingData = true;
clearTimeout(this.timeoutId);
this.handleRpcResponse(context, keyedAccountInfo);
this.setTimeout();
} else {
this.handleRpcResponse(context, keyedAccountInfo);
}
},
this.options.commitment ??
(this.program.provider as AnchorProvider).opts.commitment,
this.options.filters
);
if (this.resubOpts?.resubTimeoutMs) {
this.receivingData = true;
this.setTimeout();
}
}
protected setTimeout(): void {
if (!this.onChange) {
throw new Error('onChange callback function must be set');
}
this.timeoutId = setTimeout(
async () => {
if (this.isUnsubscribing) {
// If we are in the process of unsubscribing, do not attempt to resubscribe
return;
}
if (this.receivingData) {
if (this.resubOpts?.logResubMessages) {
console.log(
`No ws data from ${this.subscriptionName} in ${this.resubOpts?.resubTimeoutMs}ms, resubscribing`
);
}
await this.unsubscribe(true);
this.receivingData = false;
await this.subscribe(this.onChange);
}
},
this.resubOpts?.resubTimeoutMs
);
}
handleRpcResponse(
context: Context,
keyedAccountInfo: KeyedAccountInfo
): void {
const newSlot = context.slot;
let newBuffer: Buffer | undefined = undefined;
if (keyedAccountInfo) {
newBuffer = keyedAccountInfo.accountInfo.data;
}
const accountId = keyedAccountInfo.accountId.toBase58();
const existingBufferAndSlot = this.bufferAndSlotMap.get(accountId);
if (!existingBufferAndSlot) {
if (newBuffer) {
this.bufferAndSlotMap.set(accountId, {
buffer: newBuffer,
slot: newSlot,
});
const account = this.decodeBuffer(this.accountDiscriminator, newBuffer);
this.onChange(keyedAccountInfo.accountId, account, context, newBuffer);
}
return;
}
if (newSlot < existingBufferAndSlot.slot) {
return;
}
const oldBuffer = existingBufferAndSlot.buffer;
if (newBuffer && (!oldBuffer || !newBuffer.equals(oldBuffer))) {
this.bufferAndSlotMap.set(accountId, {
buffer: newBuffer,
slot: newSlot,
});
const account = this.decodeBuffer(this.accountDiscriminator, newBuffer);
this.onChange(keyedAccountInfo.accountId, account, context, newBuffer);
}
}
unsubscribe(onResub = false): Promise<void> {
if (!onResub) {
this.resubOpts.resubTimeoutMs = undefined;
}
this.isUnsubscribing = true;
clearTimeout(this.timeoutId);
this.timeoutId = undefined;
if (this.listenerId != null) {
const promise = this.program.provider.connection
.removeAccountChangeListener(this.listenerId)
.then(() => {
this.listenerId = undefined;
this.isUnsubscribing = false;
});
return promise;
} else {
this.isUnsubscribing = false;
}
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/grpcDriftClientAccountSubscriber.ts
|
import { WebSocketDriftClientAccountSubscriber } from './webSocketDriftClientAccountSubscriber';
import { OracleInfo, OraclePriceData } from '../oracles/types';
import { Program } from '@coral-xyz/anchor';
import { findAllMarketAndOracles } from '../config';
import {
getDriftStateAccountPublicKey,
getPerpMarketPublicKey,
getSpotMarketPublicKey,
} from '../addresses/pda';
import { DelistedMarketSetting, GrpcConfigs, ResubOpts } from './types';
import { grpcAccountSubscriber } from './grpcAccountSubscriber';
import { PerpMarketAccount, SpotMarketAccount, StateAccount } from '../types';
import { getOracleId } from '../oracles/oracleId';
export class gprcDriftClientAccountSubscriber extends WebSocketDriftClientAccountSubscriber {
private grpcConfigs: GrpcConfigs;
constructor(
grpcConfigs: GrpcConfigs,
program: Program,
perpMarketIndexes: number[],
spotMarketIndexes: number[],
oracleInfos: OracleInfo[],
shouldFindAllMarketsAndOracles: boolean,
delistedMarketSetting: DelistedMarketSetting,
resubOpts?: ResubOpts
) {
super(
program,
perpMarketIndexes,
spotMarketIndexes,
oracleInfos,
shouldFindAllMarketsAndOracles,
delistedMarketSetting,
resubOpts
);
this.grpcConfigs = grpcConfigs;
}
public async subscribe(): Promise<boolean> {
if (this.isSubscribed) {
return true;
}
if (this.isSubscribing) {
return await this.subscriptionPromise;
}
this.isSubscribing = true;
this.subscriptionPromise = new Promise((res) => {
this.subscriptionPromiseResolver = res;
});
if (this.shouldFindAllMarketsAndOracles) {
const {
perpMarketIndexes,
perpMarketAccounts,
spotMarketIndexes,
spotMarketAccounts,
oracleInfos,
} = await findAllMarketAndOracles(this.program);
this.perpMarketIndexes = perpMarketIndexes;
this.spotMarketIndexes = spotMarketIndexes;
this.oracleInfos = oracleInfos;
// front run and set the initial data here to save extra gma call in set initial data
this.initialPerpMarketAccountData = new Map(
perpMarketAccounts.map((market) => [market.marketIndex, market])
);
this.initialSpotMarketAccountData = new Map(
spotMarketAccounts.map((market) => [market.marketIndex, market])
);
}
const statePublicKey = await getDriftStateAccountPublicKey(
this.program.programId
);
// create and activate main state account subscription
this.stateAccountSubscriber = new grpcAccountSubscriber(
this.grpcConfigs,
'state',
this.program,
statePublicKey,
undefined,
undefined
);
await this.stateAccountSubscriber.subscribe((data: StateAccount) => {
this.eventEmitter.emit('stateAccountUpdate', data);
this.eventEmitter.emit('update');
});
// set initial data to avoid spamming getAccountInfo calls in webSocketAccountSubscriber
await this.setInitialData();
await Promise.all([
// subscribe to market accounts
this.subscribeToPerpMarketAccounts(),
// subscribe to spot market accounts
this.subscribeToSpotMarketAccounts(),
// subscribe to oracles
this.subscribeToOracles(),
]);
this.eventEmitter.emit('update');
await this.handleDelistedMarkets();
await Promise.all([this.setPerpOracleMap(), this.setSpotOracleMap()]);
this.subscriptionPromiseResolver(true);
this.isSubscribing = false;
this.isSubscribed = true;
// delete initial data
this.removeInitialData();
return true;
}
override async subscribeToSpotMarketAccount(
marketIndex: number
): Promise<boolean> {
const marketPublicKey = await getSpotMarketPublicKey(
this.program.programId,
marketIndex
);
const accountSubscriber = new grpcAccountSubscriber<SpotMarketAccount>(
this.grpcConfigs,
'spotMarket',
this.program,
marketPublicKey,
undefined,
this.resubOpts
);
accountSubscriber.setData(
this.initialSpotMarketAccountData.get(marketIndex)
);
await accountSubscriber.subscribe((data: SpotMarketAccount) => {
this.eventEmitter.emit('spotMarketAccountUpdate', data);
this.eventEmitter.emit('update');
});
this.spotMarketAccountSubscribers.set(marketIndex, accountSubscriber);
return true;
}
async subscribeToPerpMarketAccount(marketIndex: number): Promise<boolean> {
const perpMarketPublicKey = await getPerpMarketPublicKey(
this.program.programId,
marketIndex
);
const accountSubscriber = new grpcAccountSubscriber<PerpMarketAccount>(
this.grpcConfigs,
'perpMarket',
this.program,
perpMarketPublicKey,
undefined,
this.resubOpts
);
accountSubscriber.setData(
this.initialPerpMarketAccountData.get(marketIndex)
);
await accountSubscriber.subscribe((data: PerpMarketAccount) => {
this.eventEmitter.emit('perpMarketAccountUpdate', data);
this.eventEmitter.emit('update');
});
this.perpMarketAccountSubscribers.set(marketIndex, accountSubscriber);
return true;
}
async subscribeToOracle(oracleInfo: OracleInfo): Promise<boolean> {
const oracleId = getOracleId(oracleInfo.publicKey, oracleInfo.source);
const client = this.oracleClientCache.get(
oracleInfo.source,
this.program.provider.connection,
this.program
);
const accountSubscriber = new grpcAccountSubscriber<OraclePriceData>(
this.grpcConfigs,
'oracle',
this.program,
oracleInfo.publicKey,
(buffer: Buffer) => {
return client.getOraclePriceDataFromBuffer(buffer);
},
this.resubOpts
);
accountSubscriber.setData(this.initialOraclePriceData.get(oracleId));
await accountSubscriber.subscribe((data: OraclePriceData) => {
this.eventEmitter.emit(
'oraclePriceUpdate',
oracleInfo.publicKey,
oracleInfo.source,
data
);
this.eventEmitter.emit('update');
});
this.oracleSubscribers.set(oracleId, accountSubscriber);
return true;
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/types.ts
|
import {
SpotMarketAccount,
PerpMarketAccount,
OracleSource,
StateAccount,
UserAccount,
UserStatsAccount,
InsuranceFundStake,
} from '../types';
import StrictEventEmitter from 'strict-event-emitter-types';
import { EventEmitter } from 'events';
import { Context, PublicKey } from '@solana/web3.js';
import { Account } from '@solana/spl-token';
import { HighLeverageModeConfig, OracleInfo, OraclePriceData } from '..';
import { ChannelOptions, CommitmentLevel } from '../isomorphic/grpc';
export interface AccountSubscriber<T> {
dataAndSlot?: DataAndSlot<T>;
subscribe(onChange: (data: T) => void): Promise<void>;
fetch(): Promise<void>;
unsubscribe(): Promise<void>;
setData(userAccount: T, slot?: number): void;
}
export interface ProgramAccountSubscriber<T> {
subscribe(
onChange: (
accountId: PublicKey,
data: T,
context: Context,
buffer: Buffer
) => void
): Promise<void>;
unsubscribe(): Promise<void>;
}
export class NotSubscribedError extends Error {
name = 'NotSubscribedError';
}
export interface DriftClientAccountEvents {
stateAccountUpdate: (payload: StateAccount) => void;
perpMarketAccountUpdate: (payload: PerpMarketAccount) => void;
spotMarketAccountUpdate: (payload: SpotMarketAccount) => void;
oraclePriceUpdate: (
publicKey: PublicKey,
oracleSource: OracleSource,
data: OraclePriceData
) => void;
userAccountUpdate: (payload: UserAccount) => void;
update: void;
error: (e: Error) => void;
}
export interface DriftClientAccountSubscriber {
eventEmitter: StrictEventEmitter<EventEmitter, DriftClientAccountEvents>;
isSubscribed: boolean;
subscribe(): Promise<boolean>;
fetch(): Promise<void>;
unsubscribe(): Promise<void>;
addPerpMarket(marketIndex: number): Promise<boolean>;
addSpotMarket(marketIndex: number): Promise<boolean>;
addOracle(oracleInfo: OracleInfo): Promise<boolean>;
setPerpOracleMap(): Promise<void>;
setSpotOracleMap(): Promise<void>;
getStateAccountAndSlot(): DataAndSlot<StateAccount>;
getMarketAccountAndSlot(
marketIndex: number
): DataAndSlot<PerpMarketAccount> | undefined;
getMarketAccountsAndSlots(): DataAndSlot<PerpMarketAccount>[];
getSpotMarketAccountAndSlot(
marketIndex: number
): DataAndSlot<SpotMarketAccount> | undefined;
getSpotMarketAccountsAndSlots(): DataAndSlot<SpotMarketAccount>[];
getOraclePriceDataAndSlot(
oracleId: string
): DataAndSlot<OraclePriceData> | undefined;
getOraclePriceDataAndSlotForPerpMarket(
marketIndex: number
): DataAndSlot<OraclePriceData> | undefined;
getOraclePriceDataAndSlotForSpotMarket(
marketIndex: number
): DataAndSlot<OraclePriceData> | undefined;
updateAccountLoaderPollingFrequency?: (pollingFrequency: number) => void;
}
export enum DelistedMarketSetting {
Unsubscribe,
Subscribe,
Discard,
}
export interface UserAccountEvents {
userAccountUpdate: (payload: UserAccount) => void;
update: void;
error: (e: Error) => void;
}
export interface UserAccountSubscriber {
eventEmitter: StrictEventEmitter<EventEmitter, UserAccountEvents>;
isSubscribed: boolean;
subscribe(userAccount?: UserAccount): Promise<boolean>;
fetch(): Promise<void>;
updateData(userAccount: UserAccount, slot: number): void;
unsubscribe(): Promise<void>;
getUserAccountAndSlot(): DataAndSlot<UserAccount>;
}
export interface TokenAccountEvents {
tokenAccountUpdate: (payload: Account) => void;
update: void;
error: (e: Error) => void;
}
export interface TokenAccountSubscriber {
eventEmitter: StrictEventEmitter<EventEmitter, TokenAccountEvents>;
isSubscribed: boolean;
subscribe(): Promise<boolean>;
fetch(): Promise<void>;
unsubscribe(): Promise<void>;
getTokenAccountAndSlot(): DataAndSlot<Account>;
}
export interface InsuranceFundStakeAccountSubscriber {
eventEmitter: StrictEventEmitter<
EventEmitter,
InsuranceFundStakeAccountEvents
>;
isSubscribed: boolean;
subscribe(): Promise<boolean>;
fetch(): Promise<void>;
unsubscribe(): Promise<void>;
getInsuranceFundStakeAccountAndSlot(): DataAndSlot<InsuranceFundStake>;
}
export interface InsuranceFundStakeAccountEvents {
insuranceFundStakeAccountUpdate: (payload: InsuranceFundStake) => void;
update: void;
error: (e: Error) => void;
}
export interface OracleEvents {
oracleUpdate: (payload: OraclePriceData) => void;
update: void;
error: (e: Error) => void;
}
export interface OracleAccountSubscriber {
eventEmitter: StrictEventEmitter<EventEmitter, OracleEvents>;
isSubscribed: boolean;
subscribe(): Promise<boolean>;
fetch(): Promise<void>;
unsubscribe(): Promise<void>;
getOraclePriceData(): DataAndSlot<OraclePriceData>;
}
export type AccountToPoll = {
key: string;
publicKey: PublicKey;
eventType: string;
callbackId?: string;
mapKey?: number;
};
export type OraclesToPoll = {
publicKey: PublicKey;
source: OracleSource;
callbackId?: string;
};
export type BufferAndSlot = {
slot: number;
buffer: Buffer | undefined;
};
export type DataAndSlot<T> = {
data: T;
slot: number;
};
export type ResubOpts = {
resubTimeoutMs?: number;
logResubMessages?: boolean;
};
export interface UserStatsAccountEvents {
userStatsAccountUpdate: (payload: UserStatsAccount) => void;
update: void;
error: (e: Error) => void;
}
export interface UserStatsAccountSubscriber {
eventEmitter: StrictEventEmitter<EventEmitter, UserStatsAccountEvents>;
isSubscribed: boolean;
subscribe(userStatsAccount?: UserStatsAccount): Promise<boolean>;
fetch(): Promise<void>;
unsubscribe(): Promise<void>;
getUserStatsAccountAndSlot(): DataAndSlot<UserStatsAccount>;
}
export type GrpcConfigs = {
endpoint: string;
token: string;
commitmentLevel?: CommitmentLevel;
channelOptions?: ChannelOptions;
};
export interface HighLeverageModeConfigAccountSubscriber {
eventEmitter: StrictEventEmitter<
EventEmitter,
HighLeverageModeConfigAccountEvents
>;
isSubscribed: boolean;
subscribe(
highLeverageModeConfigAccount?: HighLeverageModeConfig
): Promise<boolean>;
fetch(): Promise<void>;
unsubscribe(): Promise<void>;
getHighLeverageModeConfigAccountAndSlot(): DataAndSlot<HighLeverageModeConfig>;
}
export interface HighLeverageModeConfigAccountEvents {
highLeverageModeConfigAccountUpdate: (
payload: HighLeverageModeConfig
) => void;
update: void;
error: (e: Error) => void;
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/pollingHighLeverageModeConfigAccountSubscriber.ts
|
import {
DataAndSlot,
NotSubscribedError,
HighLeverageModeConfigAccountEvents,
HighLeverageModeConfigAccountSubscriber,
} from './types';
import { Program } from '@coral-xyz/anchor';
import StrictEventEmitter from 'strict-event-emitter-types';
import { EventEmitter } from 'events';
import { PublicKey } from '@solana/web3.js';
import { BulkAccountLoader } from './bulkAccountLoader';
import { HighLeverageModeConfig } from '../types';
export class PollingHighLeverageModeConfigAccountSubscriber
implements HighLeverageModeConfigAccountSubscriber
{
isSubscribed: boolean;
program: Program;
eventEmitter: StrictEventEmitter<
EventEmitter,
HighLeverageModeConfigAccountEvents
>;
highLeverageModeConfigAccountPublicKey: PublicKey;
accountLoader: BulkAccountLoader;
callbackId?: string;
errorCallbackId?: string;
highLeverageModeConfigAccountAndSlot?: DataAndSlot<HighLeverageModeConfig>;
public constructor(
program: Program,
publicKey: PublicKey,
accountLoader: BulkAccountLoader
) {
this.isSubscribed = false;
this.program = program;
this.highLeverageModeConfigAccountPublicKey = publicKey;
this.accountLoader = accountLoader;
this.eventEmitter = new EventEmitter();
}
async subscribe(
highLeverageModeConfig?: HighLeverageModeConfig
): Promise<boolean> {
if (this.isSubscribed) {
return true;
}
if (highLeverageModeConfig) {
this.highLeverageModeConfigAccountAndSlot = {
data: highLeverageModeConfig,
slot: undefined,
};
}
await this.addToAccountLoader();
await this.fetchIfUnloaded();
if (this.doesAccountExist()) {
this.eventEmitter.emit('update');
}
this.isSubscribed = true;
return true;
}
async addToAccountLoader(): Promise<void> {
if (this.callbackId) {
return;
}
this.callbackId = await this.accountLoader.addAccount(
this.highLeverageModeConfigAccountPublicKey,
(buffer, slot: number) => {
if (!buffer) {
return;
}
if (
this.highLeverageModeConfigAccountAndSlot &&
this.highLeverageModeConfigAccountAndSlot.slot > slot
) {
return;
}
const account = this.program.account.user.coder.accounts.decode(
'HighLeverageModeConfig',
buffer
);
this.highLeverageModeConfigAccountAndSlot = { data: account, slot };
this.eventEmitter.emit('highLeverageModeConfigAccountUpdate', account);
this.eventEmitter.emit('update');
}
);
this.errorCallbackId = this.accountLoader.addErrorCallbacks((error) => {
this.eventEmitter.emit('error', error);
});
}
async fetchIfUnloaded(): Promise<void> {
if (this.highLeverageModeConfigAccountAndSlot === undefined) {
await this.fetch();
}
}
async fetch(): Promise<void> {
try {
const dataAndContext =
await this.program.account.highLeverageModeConfig.fetchAndContext(
this.highLeverageModeConfigAccountPublicKey,
this.accountLoader.commitment
);
if (
dataAndContext.context.slot >
(this.highLeverageModeConfigAccountAndSlot?.slot ?? 0)
) {
this.highLeverageModeConfigAccountAndSlot = {
data: dataAndContext.data as HighLeverageModeConfig,
slot: dataAndContext.context.slot,
};
}
} catch (e) {
console.log(
`PollingHighLeverageModeConfigAccountSubscriber.fetch() HighLeverageModeConfig does not exist: ${e.message}`
);
}
}
doesAccountExist(): boolean {
return this.highLeverageModeConfigAccountAndSlot !== undefined;
}
async unsubscribe(): Promise<void> {
if (!this.isSubscribed) {
return;
}
this.accountLoader.removeAccount(
this.highLeverageModeConfigAccountPublicKey,
this.callbackId
);
this.callbackId = undefined;
this.accountLoader.removeErrorCallbacks(this.errorCallbackId);
this.errorCallbackId = undefined;
this.isSubscribed = false;
}
assertIsSubscribed(): void {
if (!this.isSubscribed) {
throw new NotSubscribedError(
'You must call `subscribe` before using this function'
);
}
}
public getHighLeverageModeConfigAccountAndSlot(): DataAndSlot<HighLeverageModeConfig> {
this.assertIsSubscribed();
return this.highLeverageModeConfigAccountAndSlot;
}
didSubscriptionSucceed(): boolean {
return !!this.highLeverageModeConfigAccountAndSlot;
}
public updateData(
highLeverageModeConfig: HighLeverageModeConfig,
slot: number
): void {
if (
!this.highLeverageModeConfigAccountAndSlot ||
this.highLeverageModeConfigAccountAndSlot.slot < slot
) {
this.highLeverageModeConfigAccountAndSlot = {
data: highLeverageModeConfig,
slot,
};
this.eventEmitter.emit(
'highLeverageModeConfigAccountUpdate',
highLeverageModeConfig
);
this.eventEmitter.emit('update');
}
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/webSocketDriftClientAccountSubscriber.ts
|
import {
AccountSubscriber,
DataAndSlot,
DelistedMarketSetting,
DriftClientAccountEvents,
DriftClientAccountSubscriber,
NotSubscribedError,
ResubOpts,
} from './types';
import { PerpMarketAccount, SpotMarketAccount, StateAccount } from '../types';
import { Program } from '@coral-xyz/anchor';
import StrictEventEmitter from 'strict-event-emitter-types';
import { EventEmitter } from 'events';
import {
getDriftStateAccountPublicKey,
getPerpMarketPublicKey,
getPerpMarketPublicKeySync,
getSpotMarketPublicKey,
getSpotMarketPublicKeySync,
} from '../addresses/pda';
import { WebSocketAccountSubscriber } from './webSocketAccountSubscriber';
import { Commitment, PublicKey } from '@solana/web3.js';
import { OracleInfo, OraclePriceData } from '../oracles/types';
import { OracleClientCache } from '../oracles/oracleClientCache';
import * as Buffer from 'buffer';
import { QUOTE_ORACLE_PRICE_DATA } from '../oracles/quoteAssetOracleClient';
import { findAllMarketAndOracles } from '../config';
import { findDelistedPerpMarketsAndOracles } from './utils';
import { getOracleId } from '../oracles/oracleId';
import { OracleSource } from '../types';
const ORACLE_DEFAULT_ID = getOracleId(
PublicKey.default,
OracleSource.QUOTE_ASSET
);
export class WebSocketDriftClientAccountSubscriber
implements DriftClientAccountSubscriber
{
isSubscribed: boolean;
program: Program;
commitment?: Commitment;
perpMarketIndexes: number[];
spotMarketIndexes: number[];
oracleInfos: OracleInfo[];
oracleClientCache = new OracleClientCache();
resubOpts?: ResubOpts;
shouldFindAllMarketsAndOracles: boolean;
eventEmitter: StrictEventEmitter<EventEmitter, DriftClientAccountEvents>;
stateAccountSubscriber?: AccountSubscriber<StateAccount>;
perpMarketAccountSubscribers = new Map<
number,
AccountSubscriber<PerpMarketAccount>
>();
perpOracleMap = new Map<number, PublicKey>();
perpOracleStringMap = new Map<number, string>();
spotMarketAccountSubscribers = new Map<
number,
AccountSubscriber<SpotMarketAccount>
>();
spotOracleMap = new Map<number, PublicKey>();
spotOracleStringMap = new Map<number, string>();
oracleSubscribers = new Map<string, AccountSubscriber<OraclePriceData>>();
delistedMarketSetting: DelistedMarketSetting;
initialPerpMarketAccountData: Map<number, PerpMarketAccount>;
initialSpotMarketAccountData: Map<number, SpotMarketAccount>;
initialOraclePriceData: Map<string, OraclePriceData>;
protected isSubscribing = false;
protected subscriptionPromise: Promise<boolean>;
protected subscriptionPromiseResolver: (val: boolean) => void;
public constructor(
program: Program,
perpMarketIndexes: number[],
spotMarketIndexes: number[],
oracleInfos: OracleInfo[],
shouldFindAllMarketsAndOracles: boolean,
delistedMarketSetting: DelistedMarketSetting,
resubOpts?: ResubOpts,
commitment?: Commitment
) {
this.isSubscribed = false;
this.program = program;
this.eventEmitter = new EventEmitter();
this.perpMarketIndexes = perpMarketIndexes;
this.spotMarketIndexes = spotMarketIndexes;
this.oracleInfos = oracleInfos;
this.shouldFindAllMarketsAndOracles = shouldFindAllMarketsAndOracles;
this.delistedMarketSetting = delistedMarketSetting;
this.resubOpts = resubOpts;
this.commitment = commitment;
}
public async subscribe(): Promise<boolean> {
if (this.isSubscribed) {
return true;
}
if (this.isSubscribing) {
return await this.subscriptionPromise;
}
this.isSubscribing = true;
this.subscriptionPromise = new Promise((res) => {
this.subscriptionPromiseResolver = res;
});
if (this.shouldFindAllMarketsAndOracles) {
const {
perpMarketIndexes,
perpMarketAccounts,
spotMarketIndexes,
spotMarketAccounts,
oracleInfos,
} = await findAllMarketAndOracles(this.program);
this.perpMarketIndexes = perpMarketIndexes;
this.spotMarketIndexes = spotMarketIndexes;
this.oracleInfos = oracleInfos;
// front run and set the initial data here to save extra gma call in set initial data
this.initialPerpMarketAccountData = new Map(
perpMarketAccounts.map((market) => [market.marketIndex, market])
);
this.initialSpotMarketAccountData = new Map(
spotMarketAccounts.map((market) => [market.marketIndex, market])
);
}
const statePublicKey = await getDriftStateAccountPublicKey(
this.program.programId
);
// create and activate main state account subscription
this.stateAccountSubscriber = new WebSocketAccountSubscriber(
'state',
this.program,
statePublicKey,
undefined,
undefined,
this.commitment
);
await this.stateAccountSubscriber.subscribe((data: StateAccount) => {
this.eventEmitter.emit('stateAccountUpdate', data);
this.eventEmitter.emit('update');
});
// set initial data to avoid spamming getAccountInfo calls in webSocketAccountSubscriber
await this.setInitialData();
await Promise.all([
// subscribe to market accounts
this.subscribeToPerpMarketAccounts(),
// subscribe to spot market accounts
this.subscribeToSpotMarketAccounts(),
// subscribe to oracles
this.subscribeToOracles(),
]);
this.eventEmitter.emit('update');
await this.handleDelistedMarkets();
await Promise.all([this.setPerpOracleMap(), this.setSpotOracleMap()]);
this.isSubscribing = false;
this.isSubscribed = true;
this.subscriptionPromiseResolver(true);
// delete initial data
this.removeInitialData();
return true;
}
async setInitialData(): Promise<void> {
const connection = this.program.provider.connection;
if (!this.initialPerpMarketAccountData) {
const perpMarketPublicKeys = this.perpMarketIndexes.map((marketIndex) =>
getPerpMarketPublicKeySync(this.program.programId, marketIndex)
);
const perpMarketAccountInfos = await connection.getMultipleAccountsInfo(
perpMarketPublicKeys
);
this.initialPerpMarketAccountData = new Map(
perpMarketAccountInfos
.filter((accountInfo) => !!accountInfo)
.map((accountInfo) => {
const perpMarket = this.program.coder.accounts.decode(
'PerpMarket',
accountInfo.data
);
return [perpMarket.marketIndex, perpMarket];
})
);
}
if (!this.initialSpotMarketAccountData) {
const spotMarketPublicKeys = this.spotMarketIndexes.map((marketIndex) =>
getSpotMarketPublicKeySync(this.program.programId, marketIndex)
);
const spotMarketAccountInfos = await connection.getMultipleAccountsInfo(
spotMarketPublicKeys
);
this.initialSpotMarketAccountData = new Map(
spotMarketAccountInfos
.filter((accountInfo) => !!accountInfo)
.map((accountInfo) => {
const spotMarket = this.program.coder.accounts.decode(
'SpotMarket',
accountInfo.data
);
return [spotMarket.marketIndex, spotMarket];
})
);
}
const oracleAccountInfos = await connection.getMultipleAccountsInfo(
this.oracleInfos.map((oracleInfo) => oracleInfo.publicKey)
);
this.initialOraclePriceData = new Map(
this.oracleInfos.reduce((result, oracleInfo, i) => {
if (!oracleAccountInfos[i]) {
return result;
}
const oracleClient = this.oracleClientCache.get(
oracleInfo.source,
connection,
this.program
);
const oraclePriceData = oracleClient.getOraclePriceDataFromBuffer(
oracleAccountInfos[i].data
);
result.push([
getOracleId(oracleInfo.publicKey, oracleInfo.source),
oraclePriceData,
]);
return result;
}, [])
);
}
removeInitialData() {
this.initialPerpMarketAccountData = new Map();
this.initialSpotMarketAccountData = new Map();
this.initialOraclePriceData = new Map();
}
async subscribeToPerpMarketAccounts(): Promise<boolean> {
await Promise.all(
this.perpMarketIndexes.map((marketIndex) =>
this.subscribeToPerpMarketAccount(marketIndex)
)
);
return true;
}
async subscribeToPerpMarketAccount(marketIndex: number): Promise<boolean> {
const perpMarketPublicKey = await getPerpMarketPublicKey(
this.program.programId,
marketIndex
);
const accountSubscriber = new WebSocketAccountSubscriber<PerpMarketAccount>(
'perpMarket',
this.program,
perpMarketPublicKey,
undefined,
this.resubOpts,
this.commitment
);
accountSubscriber.setData(
this.initialPerpMarketAccountData.get(marketIndex)
);
await accountSubscriber.subscribe((data: PerpMarketAccount) => {
this.eventEmitter.emit('perpMarketAccountUpdate', data);
this.eventEmitter.emit('update');
});
this.perpMarketAccountSubscribers.set(marketIndex, accountSubscriber);
return true;
}
async subscribeToSpotMarketAccounts(): Promise<boolean> {
await Promise.all(
this.spotMarketIndexes.map((marketIndex) =>
this.subscribeToSpotMarketAccount(marketIndex)
)
);
return true;
}
async subscribeToSpotMarketAccount(marketIndex: number): Promise<boolean> {
const marketPublicKey = await getSpotMarketPublicKey(
this.program.programId,
marketIndex
);
const accountSubscriber = new WebSocketAccountSubscriber<SpotMarketAccount>(
'spotMarket',
this.program,
marketPublicKey,
undefined,
this.resubOpts,
this.commitment
);
accountSubscriber.setData(
this.initialSpotMarketAccountData.get(marketIndex)
);
await accountSubscriber.subscribe((data: SpotMarketAccount) => {
this.eventEmitter.emit('spotMarketAccountUpdate', data);
this.eventEmitter.emit('update');
});
this.spotMarketAccountSubscribers.set(marketIndex, accountSubscriber);
return true;
}
async subscribeToOracles(): Promise<boolean> {
await Promise.all(
this.oracleInfos
.filter((oracleInfo) => !oracleInfo.publicKey.equals(PublicKey.default))
.map((oracleInfo) => this.subscribeToOracle(oracleInfo))
);
return true;
}
async subscribeToOracle(oracleInfo: OracleInfo): Promise<boolean> {
const oracleId = getOracleId(oracleInfo.publicKey, oracleInfo.source);
const client = this.oracleClientCache.get(
oracleInfo.source,
this.program.provider.connection,
this.program
);
const accountSubscriber = new WebSocketAccountSubscriber<OraclePriceData>(
'oracle',
this.program,
oracleInfo.publicKey,
(buffer: Buffer) => {
return client.getOraclePriceDataFromBuffer(buffer);
},
this.resubOpts,
this.commitment
);
const initialOraclePriceData = this.initialOraclePriceData.get(oracleId);
if (initialOraclePriceData) {
accountSubscriber.setData(initialOraclePriceData);
}
await accountSubscriber.subscribe((data: OraclePriceData) => {
this.eventEmitter.emit(
'oraclePriceUpdate',
oracleInfo.publicKey,
oracleInfo.source,
data
);
this.eventEmitter.emit('update');
});
this.oracleSubscribers.set(oracleId, accountSubscriber);
return true;
}
async unsubscribeFromMarketAccounts(): Promise<void> {
await Promise.all(
Array.from(this.perpMarketAccountSubscribers.values()).map(
(accountSubscriber) => accountSubscriber.unsubscribe()
)
);
}
async unsubscribeFromSpotMarketAccounts(): Promise<void> {
await Promise.all(
Array.from(this.spotMarketAccountSubscribers.values()).map(
(accountSubscriber) => accountSubscriber.unsubscribe()
)
);
}
async unsubscribeFromOracles(): Promise<void> {
await Promise.all(
Array.from(this.oracleSubscribers.values()).map((accountSubscriber) =>
accountSubscriber.unsubscribe()
)
);
}
public async fetch(): Promise<void> {
if (!this.isSubscribed) {
return;
}
const promises = [this.stateAccountSubscriber.fetch()]
.concat(
Array.from(this.perpMarketAccountSubscribers.values()).map(
(subscriber) => subscriber.fetch()
)
)
.concat(
Array.from(this.spotMarketAccountSubscribers.values()).map(
(subscriber) => subscriber.fetch()
)
);
await Promise.all(promises);
}
public async unsubscribe(): Promise<void> {
if (!this.isSubscribed) {
return;
}
await this.stateAccountSubscriber.unsubscribe();
await this.unsubscribeFromMarketAccounts();
await this.unsubscribeFromSpotMarketAccounts();
await this.unsubscribeFromOracles();
this.isSubscribed = false;
}
async addSpotMarket(marketIndex: number): Promise<boolean> {
if (this.spotMarketAccountSubscribers.has(marketIndex)) {
return true;
}
const subscriptionSuccess = this.subscribeToSpotMarketAccount(marketIndex);
await this.setSpotOracleMap();
return subscriptionSuccess;
}
async addPerpMarket(marketIndex: number): Promise<boolean> {
if (this.perpMarketAccountSubscribers.has(marketIndex)) {
return true;
}
const subscriptionSuccess = this.subscribeToPerpMarketAccount(marketIndex);
await this.setPerpOracleMap();
return subscriptionSuccess;
}
async addOracle(oracleInfo: OracleInfo): Promise<boolean> {
const oracleId = getOracleId(oracleInfo.publicKey, oracleInfo.source);
if (this.oracleSubscribers.has(oracleId)) {
return true;
}
if (oracleInfo.publicKey.equals(PublicKey.default)) {
return true;
}
return this.subscribeToOracle(oracleInfo);
}
async setPerpOracleMap() {
const perpMarkets = this.getMarketAccountsAndSlots();
const addOraclePromises = [];
for (const perpMarket of perpMarkets) {
if (!perpMarket || !perpMarket.data) {
continue;
}
const perpMarketAccount = perpMarket.data;
const perpMarketIndex = perpMarketAccount.marketIndex;
const oracle = perpMarketAccount.amm.oracle;
const oracleId = getOracleId(oracle, perpMarket.data.amm.oracleSource);
if (!this.oracleSubscribers.has(oracleId)) {
addOraclePromises.push(
this.addOracle({
publicKey: oracle,
source: perpMarket.data.amm.oracleSource,
})
);
}
this.perpOracleMap.set(perpMarketIndex, oracle);
this.perpOracleStringMap.set(perpMarketIndex, oracleId);
}
await Promise.all(addOraclePromises);
}
async setSpotOracleMap() {
const spotMarkets = this.getSpotMarketAccountsAndSlots();
const addOraclePromises = [];
for (const spotMarket of spotMarkets) {
if (!spotMarket || !spotMarket.data) {
continue;
}
const spotMarketAccount = spotMarket.data;
const spotMarketIndex = spotMarketAccount.marketIndex;
const oracle = spotMarketAccount.oracle;
const oracleId = getOracleId(oracle, spotMarketAccount.oracleSource);
if (!this.oracleSubscribers.has(oracleId)) {
addOraclePromises.push(
this.addOracle({
publicKey: oracle,
source: spotMarketAccount.oracleSource,
})
);
}
this.spotOracleMap.set(spotMarketIndex, oracle);
this.spotOracleStringMap.set(spotMarketIndex, oracleId);
}
await Promise.all(addOraclePromises);
}
async handleDelistedMarkets(): Promise<void> {
if (this.delistedMarketSetting === DelistedMarketSetting.Subscribe) {
return;
}
const { perpMarketIndexes, oracles } = findDelistedPerpMarketsAndOracles(
this.getMarketAccountsAndSlots(),
this.getSpotMarketAccountsAndSlots()
);
for (const perpMarketIndex of perpMarketIndexes) {
await this.perpMarketAccountSubscribers
.get(perpMarketIndex)
.unsubscribe();
if (this.delistedMarketSetting === DelistedMarketSetting.Discard) {
this.perpMarketAccountSubscribers.delete(perpMarketIndex);
}
}
for (const oracle of oracles) {
const oracleId = getOracleId(oracle.publicKey, oracle.source);
await this.oracleSubscribers.get(oracleId).unsubscribe();
if (this.delistedMarketSetting === DelistedMarketSetting.Discard) {
this.oracleSubscribers.delete(oracleId);
}
}
}
assertIsSubscribed(): void {
if (!this.isSubscribed) {
throw new NotSubscribedError(
'You must call `subscribe` before using this function'
);
}
}
public getStateAccountAndSlot(): DataAndSlot<StateAccount> {
this.assertIsSubscribed();
return this.stateAccountSubscriber.dataAndSlot;
}
public getMarketAccountAndSlot(
marketIndex: number
): DataAndSlot<PerpMarketAccount> | undefined {
this.assertIsSubscribed();
return this.perpMarketAccountSubscribers.get(marketIndex).dataAndSlot;
}
public getMarketAccountsAndSlots(): DataAndSlot<PerpMarketAccount>[] {
return Array.from(this.perpMarketAccountSubscribers.values()).map(
(subscriber) => subscriber.dataAndSlot
);
}
public getSpotMarketAccountAndSlot(
marketIndex: number
): DataAndSlot<SpotMarketAccount> | undefined {
this.assertIsSubscribed();
return this.spotMarketAccountSubscribers.get(marketIndex).dataAndSlot;
}
public getSpotMarketAccountsAndSlots(): DataAndSlot<SpotMarketAccount>[] {
return Array.from(this.spotMarketAccountSubscribers.values()).map(
(subscriber) => subscriber.dataAndSlot
);
}
public getOraclePriceDataAndSlot(
oracleId: string
): DataAndSlot<OraclePriceData> | undefined {
this.assertIsSubscribed();
if (oracleId === ORACLE_DEFAULT_ID) {
return {
data: QUOTE_ORACLE_PRICE_DATA,
slot: 0,
};
}
return this.oracleSubscribers.get(oracleId).dataAndSlot;
}
public getOraclePriceDataAndSlotForPerpMarket(
marketIndex: number
): DataAndSlot<OraclePriceData> | undefined {
const perpMarketAccount = this.getMarketAccountAndSlot(marketIndex);
const oracle = this.perpOracleMap.get(marketIndex);
const oracleId = this.perpOracleStringMap.get(marketIndex);
if (!perpMarketAccount || !oracleId) {
return undefined;
}
if (!perpMarketAccount.data.amm.oracle.equals(oracle)) {
// If the oracle has changed, we need to update the oracle map in background
this.setPerpOracleMap();
}
return this.getOraclePriceDataAndSlot(oracleId);
}
public getOraclePriceDataAndSlotForSpotMarket(
marketIndex: number
): DataAndSlot<OraclePriceData> | undefined {
const spotMarketAccount = this.getSpotMarketAccountAndSlot(marketIndex);
const oracle = this.spotOracleMap.get(marketIndex);
const oracleId = this.spotOracleStringMap.get(marketIndex);
if (!spotMarketAccount || !oracleId) {
return undefined;
}
if (!spotMarketAccount.data.oracle.equals(oracle)) {
// If the oracle has changed, we need to update the oracle map in background
this.setSpotOracleMap();
}
return this.getOraclePriceDataAndSlot(oracleId);
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/webSocketUserStatsAccountSubsriber.ts
|
import {
DataAndSlot,
AccountSubscriber,
NotSubscribedError,
UserStatsAccountSubscriber,
UserStatsAccountEvents,
ResubOpts,
} from './types';
import { Program } from '@coral-xyz/anchor';
import StrictEventEmitter from 'strict-event-emitter-types';
import { EventEmitter } from 'events';
import { Commitment, PublicKey } from '@solana/web3.js';
import { WebSocketAccountSubscriber } from './webSocketAccountSubscriber';
import { UserStatsAccount } from '../types';
export class WebSocketUserStatsAccountSubscriber
implements UserStatsAccountSubscriber
{
isSubscribed: boolean;
resubOpts?: ResubOpts;
commitment?: Commitment;
program: Program;
eventEmitter: StrictEventEmitter<EventEmitter, UserStatsAccountEvents>;
userStatsAccountPublicKey: PublicKey;
userStatsAccountSubscriber: AccountSubscriber<UserStatsAccount>;
public constructor(
program: Program,
userStatsAccountPublicKey: PublicKey,
resubOpts?: ResubOpts,
commitment?: Commitment
) {
this.isSubscribed = false;
this.program = program;
this.userStatsAccountPublicKey = userStatsAccountPublicKey;
this.eventEmitter = new EventEmitter();
this.resubOpts = resubOpts;
this.commitment = commitment;
}
async subscribe(userStatsAccount?: UserStatsAccount): Promise<boolean> {
if (this.isSubscribed) {
return true;
}
this.userStatsAccountSubscriber = new WebSocketAccountSubscriber(
'userStats',
this.program,
this.userStatsAccountPublicKey,
undefined,
this.resubOpts,
this.commitment
);
if (userStatsAccount) {
this.userStatsAccountSubscriber.setData(userStatsAccount);
}
await this.userStatsAccountSubscriber.subscribe(
(data: UserStatsAccount) => {
this.eventEmitter.emit('userStatsAccountUpdate', data);
this.eventEmitter.emit('update');
}
);
this.eventEmitter.emit('update');
this.isSubscribed = true;
return true;
}
async fetch(): Promise<void> {
await Promise.all([this.userStatsAccountSubscriber.fetch()]);
}
async unsubscribe(): Promise<void> {
if (!this.isSubscribed) {
return;
}
await Promise.all([this.userStatsAccountSubscriber.unsubscribe()]);
this.isSubscribed = false;
}
assertIsSubscribed(): void {
if (!this.isSubscribed) {
throw new NotSubscribedError(
'You must call `subscribe` before using this function'
);
}
}
public getUserStatsAccountAndSlot(): DataAndSlot<UserStatsAccount> {
this.assertIsSubscribed();
return this.userStatsAccountSubscriber.dataAndSlot;
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/pollingOracleAccountSubscriber.ts
|
import {
DataAndSlot,
NotSubscribedError,
OracleEvents,
OracleAccountSubscriber,
} from './types';
import { Program } from '@coral-xyz/anchor';
import StrictEventEmitter from 'strict-event-emitter-types';
import { EventEmitter } from 'events';
import { PublicKey } from '@solana/web3.js';
import { BulkAccountLoader } from './bulkAccountLoader';
import { OracleClient, OraclePriceData } from '../oracles/types';
export class PollingOracleAccountSubscriber implements OracleAccountSubscriber {
isSubscribed: boolean;
program: Program;
eventEmitter: StrictEventEmitter<EventEmitter, OracleEvents>;
publicKey: PublicKey;
accountLoader: BulkAccountLoader;
oracleClient: OracleClient;
callbackId?: string;
errorCallbackId?: string;
oraclePriceData?: DataAndSlot<OraclePriceData>;
public constructor(
publicKey: PublicKey,
oracleClient: OracleClient,
accountLoader: BulkAccountLoader
) {
this.isSubscribed = false;
this.publicKey = publicKey;
this.oracleClient = oracleClient;
this.accountLoader = accountLoader;
this.eventEmitter = new EventEmitter();
}
async subscribe(): Promise<boolean> {
if (this.isSubscribed) {
return true;
}
await this.addToAccountLoader();
let subscriptionSucceeded = false;
let retries = 0;
while (!subscriptionSucceeded && retries < 5) {
await this.fetch();
subscriptionSucceeded = this.didSubscriptionSucceed();
retries++;
}
if (subscriptionSucceeded) {
this.eventEmitter.emit('update');
}
this.isSubscribed = subscriptionSucceeded;
return subscriptionSucceeded;
}
async addToAccountLoader(): Promise<void> {
if (this.callbackId) {
return;
}
this.callbackId = await this.accountLoader.addAccount(
this.publicKey,
async (buffer, slot) => {
const oraclePriceData =
await this.oracleClient.getOraclePriceDataFromBuffer(buffer);
this.oraclePriceData = { data: oraclePriceData, slot };
// @ts-ignore
this.eventEmitter.emit('oracleUpdate', oraclePriceData);
this.eventEmitter.emit('update');
}
);
this.errorCallbackId = this.accountLoader.addErrorCallbacks((error) => {
this.eventEmitter.emit('error', error);
});
}
async fetch(): Promise<void> {
await this.accountLoader.load();
const { buffer, slot } = this.accountLoader.getBufferAndSlot(
this.publicKey
);
this.oraclePriceData = {
data: await this.oracleClient.getOraclePriceDataFromBuffer(buffer),
slot,
};
}
async unsubscribe(): Promise<void> {
if (!this.isSubscribed) {
return;
}
this.accountLoader.removeAccount(this.publicKey, this.callbackId);
this.callbackId = undefined;
this.accountLoader.removeErrorCallbacks(this.errorCallbackId);
this.errorCallbackId = undefined;
this.isSubscribed = false;
}
assertIsSubscribed(): void {
if (!this.isSubscribed) {
throw new NotSubscribedError(
'You must call `subscribe` before using this function'
);
}
}
public getOraclePriceData(): DataAndSlot<OraclePriceData> {
this.assertIsSubscribed();
return this.oraclePriceData;
}
didSubscriptionSucceed(): boolean {
return !!this.oraclePriceData;
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/testBulkAccountLoader.ts
|
import { AccountToLoad, BulkAccountLoader } from './bulkAccountLoader';
export class TestBulkAccountLoader extends BulkAccountLoader {
async loadChunk(accountsToLoadChunks: AccountToLoad[][]): Promise<void> {
if (accountsToLoadChunks.length === 0) {
return;
}
const accounts = [];
for (const accountsToLoadChunk of accountsToLoadChunks) {
for (const accountToLoad of accountsToLoadChunk) {
const account = await this.connection.getAccountInfoAndContext(
accountToLoad.publicKey,
this.commitment
);
accounts.push(account);
const newSlot = account.context.slot;
if (newSlot > this.mostRecentSlot) {
this.mostRecentSlot = newSlot;
}
if (accountToLoad.callbacks.size === 0) {
return;
}
const key = accountToLoad.publicKey.toBase58();
const prev = this.bufferAndSlotMap.get(key);
if (prev && newSlot < prev.slot) {
return;
}
let newBuffer: Buffer | undefined = undefined;
if (account.value) {
newBuffer = account.value.data;
}
if (!prev) {
this.bufferAndSlotMap.set(key, { slot: newSlot, buffer: newBuffer });
this.handleAccountCallbacks(accountToLoad, newBuffer, newSlot);
return;
}
const oldBuffer = prev.buffer;
if (newBuffer && (!oldBuffer || !newBuffer.equals(oldBuffer))) {
this.bufferAndSlotMap.set(key, { slot: newSlot, buffer: newBuffer });
this.handleAccountCallbacks(accountToLoad, newBuffer, newSlot);
}
}
}
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/webSocketAccountSubscriber.ts
|
import {
DataAndSlot,
BufferAndSlot,
AccountSubscriber,
ResubOpts,
} from './types';
import { AnchorProvider, Program } from '@coral-xyz/anchor';
import { AccountInfo, Commitment, Context, PublicKey } from '@solana/web3.js';
import { capitalize } from './utils';
import * as Buffer from 'buffer';
export class WebSocketAccountSubscriber<T> implements AccountSubscriber<T> {
dataAndSlot?: DataAndSlot<T>;
bufferAndSlot?: BufferAndSlot;
accountName: string;
program: Program;
accountPublicKey: PublicKey;
decodeBufferFn: (buffer: Buffer) => T;
onChange: (data: T) => void;
listenerId?: number;
resubOpts?: ResubOpts;
commitment?: Commitment;
isUnsubscribing = false;
timeoutId?: NodeJS.Timeout;
receivingData: boolean;
public constructor(
accountName: string,
program: Program,
accountPublicKey: PublicKey,
decodeBuffer?: (buffer: Buffer) => T,
resubOpts?: ResubOpts,
commitment?: Commitment
) {
this.accountName = accountName;
this.program = program;
this.accountPublicKey = accountPublicKey;
this.decodeBufferFn = decodeBuffer;
this.resubOpts = resubOpts;
if (this.resubOpts?.resubTimeoutMs < 1000) {
console.log(
'resubTimeoutMs should be at least 1000ms to avoid spamming resub'
);
}
this.receivingData = false;
this.commitment =
commitment ?? (this.program.provider as AnchorProvider).opts.commitment;
}
async subscribe(onChange: (data: T) => void): Promise<void> {
if (this.listenerId != null || this.isUnsubscribing) {
return;
}
this.onChange = onChange;
if (!this.dataAndSlot) {
await this.fetch();
}
this.listenerId = this.program.provider.connection.onAccountChange(
this.accountPublicKey,
(accountInfo, context) => {
if (this.resubOpts?.resubTimeoutMs) {
this.receivingData = true;
clearTimeout(this.timeoutId);
this.handleRpcResponse(context, accountInfo);
this.setTimeout();
} else {
this.handleRpcResponse(context, accountInfo);
}
},
this.commitment
);
if (this.resubOpts?.resubTimeoutMs) {
this.receivingData = true;
this.setTimeout();
}
}
setData(data: T, slot?: number): void {
const newSlot = slot || 0;
if (this.dataAndSlot && this.dataAndSlot.slot > newSlot) {
return;
}
this.dataAndSlot = {
data,
slot,
};
}
protected setTimeout(): void {
if (!this.onChange) {
throw new Error('onChange callback function must be set');
}
this.timeoutId = setTimeout(
async () => {
if (this.isUnsubscribing) {
// If we are in the process of unsubscribing, do not attempt to resubscribe
return;
}
if (this.receivingData) {
if (this.resubOpts?.logResubMessages) {
console.log(
`No ws data from ${this.accountName} in ${this.resubOpts.resubTimeoutMs}ms, resubscribing`
);
}
await this.unsubscribe(true);
this.receivingData = false;
await this.subscribe(this.onChange);
}
},
this.resubOpts?.resubTimeoutMs
);
}
async fetch(): Promise<void> {
const rpcResponse =
await this.program.provider.connection.getAccountInfoAndContext(
this.accountPublicKey,
(this.program.provider as AnchorProvider).opts.commitment
);
this.handleRpcResponse(rpcResponse.context, rpcResponse?.value);
}
handleRpcResponse(context: Context, accountInfo?: AccountInfo<Buffer>): void {
const newSlot = context.slot;
let newBuffer: Buffer | undefined = undefined;
if (accountInfo) {
newBuffer = accountInfo.data;
}
if (!this.bufferAndSlot) {
this.bufferAndSlot = {
buffer: newBuffer,
slot: newSlot,
};
if (newBuffer) {
const account = this.decodeBuffer(newBuffer);
this.dataAndSlot = {
data: account,
slot: newSlot,
};
this.onChange(account);
}
return;
}
if (newSlot < this.bufferAndSlot.slot) {
return;
}
const oldBuffer = this.bufferAndSlot.buffer;
if (newBuffer && (!oldBuffer || !newBuffer.equals(oldBuffer))) {
this.bufferAndSlot = {
buffer: newBuffer,
slot: newSlot,
};
const account = this.decodeBuffer(newBuffer);
this.dataAndSlot = {
data: account,
slot: newSlot,
};
this.onChange(account);
}
}
decodeBuffer(buffer: Buffer): T {
if (this.decodeBufferFn) {
return this.decodeBufferFn(buffer);
} else {
return this.program.account[this.accountName].coder.accounts.decode(
capitalize(this.accountName),
buffer
);
}
}
unsubscribe(onResub = false): Promise<void> {
if (!onResub && this.resubOpts) {
this.resubOpts.resubTimeoutMs = undefined;
}
this.isUnsubscribing = true;
clearTimeout(this.timeoutId);
this.timeoutId = undefined;
if (this.listenerId != null) {
const promise = this.program.provider.connection
.removeAccountChangeListener(this.listenerId)
.then(() => {
this.listenerId = undefined;
this.isUnsubscribing = false;
});
return promise;
} else {
this.isUnsubscribing = false;
}
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/bulkUserSubscription.ts
|
import { User } from '../user';
import { BulkAccountLoader } from './bulkAccountLoader';
import { PollingUserAccountSubscriber } from './pollingUserAccountSubscriber';
/**
* @param users
* @param accountLoader
*/
export async function bulkPollingUserSubscribe(
users: User[],
accountLoader: BulkAccountLoader
): Promise<void> {
if (users.length === 0) {
await accountLoader.load();
return;
}
await Promise.all(
users.map((user) => {
return (
user.accountSubscriber as PollingUserAccountSubscriber
).addToAccountLoader();
})
);
await accountLoader.load();
await Promise.all(
users.map(async (user) => {
return user.subscribe();
})
);
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/webSocketUserAccountSubscriber.ts
|
import {
DataAndSlot,
AccountSubscriber,
NotSubscribedError,
UserAccountEvents,
UserAccountSubscriber,
ResubOpts,
} from './types';
import { Program } from '@coral-xyz/anchor';
import StrictEventEmitter from 'strict-event-emitter-types';
import { EventEmitter } from 'events';
import { Commitment, PublicKey } from '@solana/web3.js';
import { WebSocketAccountSubscriber } from './webSocketAccountSubscriber';
import { UserAccount } from '../types';
export class WebSocketUserAccountSubscriber implements UserAccountSubscriber {
isSubscribed: boolean;
resubOpts?: ResubOpts;
commitment?: Commitment;
program: Program;
eventEmitter: StrictEventEmitter<EventEmitter, UserAccountEvents>;
userAccountPublicKey: PublicKey;
userDataAccountSubscriber: AccountSubscriber<UserAccount>;
public constructor(
program: Program,
userAccountPublicKey: PublicKey,
resubOpts?: ResubOpts,
commitment?: Commitment
) {
this.isSubscribed = false;
this.program = program;
this.resubOpts = resubOpts;
this.userAccountPublicKey = userAccountPublicKey;
this.eventEmitter = new EventEmitter();
this.commitment = commitment;
}
async subscribe(userAccount?: UserAccount): Promise<boolean> {
if (this.isSubscribed) {
return true;
}
this.userDataAccountSubscriber = new WebSocketAccountSubscriber(
'user',
this.program,
this.userAccountPublicKey,
undefined,
this.resubOpts,
this.commitment
);
if (userAccount) {
this.userDataAccountSubscriber.setData(userAccount);
}
await this.userDataAccountSubscriber.subscribe((data: UserAccount) => {
this.eventEmitter.emit('userAccountUpdate', data);
this.eventEmitter.emit('update');
});
this.eventEmitter.emit('update');
this.isSubscribed = true;
return true;
}
async fetch(): Promise<void> {
await Promise.all([this.userDataAccountSubscriber.fetch()]);
}
async unsubscribe(): Promise<void> {
if (!this.isSubscribed) {
return;
}
await Promise.all([this.userDataAccountSubscriber.unsubscribe()]);
this.isSubscribed = false;
}
assertIsSubscribed(): void {
if (!this.isSubscribed) {
throw new NotSubscribedError(
'You must call `subscribe` before using this function'
);
}
}
public getUserAccountAndSlot(): DataAndSlot<UserAccount> {
this.assertIsSubscribed();
return this.userDataAccountSubscriber.dataAndSlot;
}
public updateData(userAccount: UserAccount, slot: number) {
const currentDataSlot =
this.userDataAccountSubscriber.dataAndSlot?.slot || 0;
if (currentDataSlot <= slot) {
this.userDataAccountSubscriber.setData(userAccount, slot);
this.eventEmitter.emit('userAccountUpdate', userAccount);
this.eventEmitter.emit('update');
}
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/pollingUserAccountSubscriber.ts
|
import {
DataAndSlot,
NotSubscribedError,
UserAccountEvents,
UserAccountSubscriber,
} from './types';
import { Connection } from '../bankrun/bankrunConnection';
import StrictEventEmitter from 'strict-event-emitter-types';
import { EventEmitter } from 'events';
import { PublicKey } from '@solana/web3.js';
import { UserAccount } from '../types';
import { BulkAccountLoader } from './bulkAccountLoader';
export class PollingUserAccountSubscriber implements UserAccountSubscriber {
isSubscribed: boolean;
connection: Connection;
eventEmitter: StrictEventEmitter<EventEmitter, UserAccountEvents>;
userAccountPublicKey: PublicKey;
accountLoader: BulkAccountLoader;
callbackId?: string;
errorCallbackId?: string;
decode: (name, buffer) => UserAccount;
user?: DataAndSlot<UserAccount>;
public constructor(
connection: Connection,
userAccountPublicKey: PublicKey,
accountLoader: BulkAccountLoader,
decode: (name, buffer) => UserAccount
) {
this.isSubscribed = false;
this.connection = connection;
this.accountLoader = accountLoader;
this.eventEmitter = new EventEmitter();
this.userAccountPublicKey = userAccountPublicKey;
this.decode = decode;
}
async subscribe(userAccount?: UserAccount): Promise<boolean> {
if (this.isSubscribed) {
return true;
}
if (userAccount) {
this.user = { data: userAccount, slot: undefined };
}
await this.addToAccountLoader();
await this.fetchIfUnloaded();
if (this.doesAccountExist()) {
this.eventEmitter.emit('update');
}
this.isSubscribed = true;
return true;
}
async addToAccountLoader(): Promise<void> {
if (this.callbackId) {
return;
}
this.callbackId = await this.accountLoader.addAccount(
this.userAccountPublicKey,
(buffer, slot: number) => {
if (!buffer) {
return;
}
if (this.user && this.user.slot > slot) {
return;
}
const account = this.decode('User', buffer);
this.user = { data: account, slot };
this.eventEmitter.emit('userAccountUpdate', account);
this.eventEmitter.emit('update');
}
);
this.errorCallbackId = this.accountLoader.addErrorCallbacks((error) => {
this.eventEmitter.emit('error', error);
});
}
async fetchIfUnloaded(): Promise<void> {
if (this.user === undefined) {
await this.fetch();
}
}
async fetch(): Promise<void> {
try {
const dataAndContext = await this.connection.getAccountInfoAndContext(
this.userAccountPublicKey,
this.accountLoader.commitment
);
if (dataAndContext.context.slot > (this.user?.slot ?? 0)) {
this.user = {
data: this.decode('User', dataAndContext.value.data),
slot: dataAndContext.context.slot,
};
}
} catch (e) {
console.log(
`PollingUserAccountSubscriber.fetch() UserAccount does not exist: ${e.message}-${e.stack}`
);
}
}
doesAccountExist(): boolean {
return this.user !== undefined;
}
async unsubscribe(): Promise<void> {
if (!this.isSubscribed) {
return;
}
this.accountLoader.removeAccount(
this.userAccountPublicKey,
this.callbackId
);
this.callbackId = undefined;
this.accountLoader.removeErrorCallbacks(this.errorCallbackId);
this.errorCallbackId = undefined;
this.isSubscribed = false;
}
assertIsSubscribed(): void {
if (!this.isSubscribed) {
throw new NotSubscribedError(
'You must call `subscribe` before using this function'
);
}
}
public getUserAccountAndSlot(): DataAndSlot<UserAccount> {
if (!this.doesAccountExist()) {
throw new NotSubscribedError(
'You must call `subscribe` or `fetch` before using this function'
);
}
return this.user;
}
public updateData(userAccount: UserAccount, slot: number): void {
if (!this.user || this.user.slot < slot) {
this.user = { data: userAccount, slot };
this.eventEmitter.emit('userAccountUpdate', userAccount);
this.eventEmitter.emit('update');
}
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/webSocketInsuranceFundStakeAccountSubscriber.ts
|
import {
DataAndSlot,
AccountSubscriber,
NotSubscribedError,
InsuranceFundStakeAccountEvents,
InsuranceFundStakeAccountSubscriber,
} from './types';
import { Program } from '@coral-xyz/anchor';
import StrictEventEmitter from 'strict-event-emitter-types';
import { EventEmitter } from 'events';
import { Commitment, PublicKey } from '@solana/web3.js';
import { WebSocketAccountSubscriber } from './webSocketAccountSubscriber';
import { InsuranceFundStake } from '../types';
export class WebSocketInsuranceFundStakeAccountSubscriber
implements InsuranceFundStakeAccountSubscriber
{
isSubscribed: boolean;
resubTimeoutMs?: number;
commitment?: Commitment;
program: Program;
eventEmitter: StrictEventEmitter<
EventEmitter,
InsuranceFundStakeAccountEvents
>;
insuranceFundStakeAccountPublicKey: PublicKey;
insuranceFundStakeDataAccountSubscriber: AccountSubscriber<InsuranceFundStake>;
public constructor(
program: Program,
insuranceFundStakeAccountPublicKey: PublicKey,
resubTimeoutMs?: number,
commitment?: Commitment
) {
this.isSubscribed = false;
this.program = program;
this.insuranceFundStakeAccountPublicKey =
insuranceFundStakeAccountPublicKey;
this.eventEmitter = new EventEmitter();
this.resubTimeoutMs = resubTimeoutMs;
this.commitment = commitment;
}
async subscribe(
insuranceFundStakeAccount?: InsuranceFundStake
): Promise<boolean> {
if (this.isSubscribed) {
return true;
}
this.insuranceFundStakeDataAccountSubscriber =
new WebSocketAccountSubscriber(
'insuranceFundStake',
this.program,
this.insuranceFundStakeAccountPublicKey,
undefined,
{
resubTimeoutMs: this.resubTimeoutMs,
},
this.commitment
);
if (insuranceFundStakeAccount) {
this.insuranceFundStakeDataAccountSubscriber.setData(
insuranceFundStakeAccount
);
}
await this.insuranceFundStakeDataAccountSubscriber.subscribe(
(data: InsuranceFundStake) => {
this.eventEmitter.emit('insuranceFundStakeAccountUpdate', data);
this.eventEmitter.emit('update');
}
);
this.eventEmitter.emit('update');
this.isSubscribed = true;
return true;
}
async fetch(): Promise<void> {
await Promise.all([this.insuranceFundStakeDataAccountSubscriber.fetch()]);
}
async unsubscribe(): Promise<void> {
if (!this.isSubscribed) {
return;
}
await Promise.all([
this.insuranceFundStakeDataAccountSubscriber.unsubscribe(),
]);
this.isSubscribed = false;
}
assertIsSubscribed(): void {
if (!this.isSubscribed) {
throw new NotSubscribedError(
'You must call `subscribe` before using this function'
);
}
}
public getInsuranceFundStakeAccountAndSlot(): DataAndSlot<InsuranceFundStake> {
this.assertIsSubscribed();
return this.insuranceFundStakeDataAccountSubscriber.dataAndSlot;
}
public updateData(
insuranceFundStake: InsuranceFundStake,
slot: number
): void {
const currentDataSlot =
this.insuranceFundStakeDataAccountSubscriber.dataAndSlot?.slot || 0;
if (currentDataSlot <= slot) {
this.insuranceFundStakeDataAccountSubscriber.setData(
insuranceFundStake,
slot
);
this.eventEmitter.emit(
'insuranceFundStakeAccountUpdate',
insuranceFundStake
);
this.eventEmitter.emit('update');
}
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/grpcUserAccountSubscriber.ts
|
import { ResubOpts, GrpcConfigs } from './types';
import { Program } from '@coral-xyz/anchor';
import { PublicKey } from '@solana/web3.js';
import { UserAccount } from '../types';
import { WebSocketUserAccountSubscriber } from './webSocketUserAccountSubscriber';
import { grpcAccountSubscriber } from './grpcAccountSubscriber';
export class grpcUserAccountSubscriber extends WebSocketUserAccountSubscriber {
private grpcConfigs: GrpcConfigs;
public constructor(
grpcConfigs: GrpcConfigs,
program: Program,
userAccountPublicKey: PublicKey,
resubOpts?: ResubOpts
) {
super(program, userAccountPublicKey, resubOpts);
this.grpcConfigs = grpcConfigs;
}
async subscribe(userAccount?: UserAccount): Promise<boolean> {
if (this.isSubscribed) {
return true;
}
this.userDataAccountSubscriber = new grpcAccountSubscriber(
this.grpcConfigs,
'user',
this.program,
this.userAccountPublicKey,
undefined,
this.resubOpts
);
if (userAccount) {
this.userDataAccountSubscriber.setData(userAccount);
}
await this.userDataAccountSubscriber.subscribe((data: UserAccount) => {
this.eventEmitter.emit('userAccountUpdate', data);
this.eventEmitter.emit('update');
});
this.eventEmitter.emit('update');
this.isSubscribed = true;
return true;
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/oneShotUserAccountSubscriber.ts
|
import { Commitment, PublicKey } from '@solana/web3.js';
import { UserAccount } from '../types';
import { BasicUserAccountSubscriber } from './basicUserAccountSubscriber';
import { Program } from '@coral-xyz/anchor';
import { UserAccountSubscriber } from './types';
/**
* Simple implementation of UserAccountSubscriber. It will fetch the UserAccount
* date on subscribe (or call to fetch) if no account data is provided on init.
* Expect to use only 1 RPC call unless you call fetch repeatedly.
*/
export class OneShotUserAccountSubscriber
extends BasicUserAccountSubscriber
implements UserAccountSubscriber
{
program: Program;
commitment: Commitment;
public constructor(
program: Program,
userAccountPublicKey: PublicKey,
data?: UserAccount,
slot?: number,
commitment?: Commitment
) {
super(userAccountPublicKey, data, slot);
this.program = program;
this.commitment = commitment ?? 'confirmed';
}
async subscribe(userAccount?: UserAccount): Promise<boolean> {
if (userAccount) {
this.user = { data: userAccount, slot: this.user.slot };
return true;
}
await this.fetchIfUnloaded();
if (this.doesAccountExist()) {
this.eventEmitter.emit('update');
}
return true;
}
async fetchIfUnloaded(): Promise<void> {
if (this.user.data === undefined) {
await this.fetch();
}
}
async fetch(): Promise<void> {
try {
const dataAndContext = await this.program.account.user.fetchAndContext(
this.userAccountPublicKey,
this.commitment
);
if (dataAndContext.context.slot > (this.user?.slot ?? 0)) {
this.user = {
data: dataAndContext.data as UserAccount,
slot: dataAndContext.context.slot,
};
}
} catch (e) {
console.error(
`OneShotUserAccountSubscriber.fetch() UserAccount does not exist: ${e.message}`
);
}
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/accounts/fetch.ts
|
import { Connection, PublicKey } from '@solana/web3.js';
import { UserAccount, UserStatsAccount } from '../types';
import {
getUserAccountPublicKey,
getUserStatsAccountPublicKey,
} from '../addresses/pda';
import { Program } from '@coral-xyz/anchor';
export async function fetchUserAccounts(
connection: Connection,
program: Program,
authority: PublicKey,
limit = 8
): Promise<(UserAccount | undefined)[]> {
const userAccountPublicKeys = new Array<PublicKey>();
for (let i = 0; i < limit; i++) {
userAccountPublicKeys.push(
await getUserAccountPublicKey(program.programId, authority, i)
);
}
return fetchUserAccountsUsingKeys(connection, program, userAccountPublicKeys);
}
export async function fetchUserAccountsUsingKeys(
connection: Connection,
program: Program,
userAccountPublicKeys: PublicKey[]
): Promise<(UserAccount | undefined)[]> {
const accountInfos = await connection.getMultipleAccountsInfo(
userAccountPublicKeys,
'confirmed'
);
return accountInfos.map((accountInfo) => {
if (!accountInfo) {
return undefined;
}
return program.account.user.coder.accounts.decodeUnchecked(
'User',
accountInfo.data
) as UserAccount;
});
}
export async function fetchUserStatsAccount(
connection: Connection,
program: Program,
authority: PublicKey
): Promise<UserStatsAccount | undefined> {
const userStatsPublicKey = getUserStatsAccountPublicKey(
program.programId,
authority
);
const accountInfo = await connection.getAccountInfo(
userStatsPublicKey,
'confirmed'
);
return accountInfo
? (program.account.user.coder.accounts.decodeUnchecked(
'UserStats',
accountInfo.data
) as UserStatsAccount)
: undefined;
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/addresses/pda.ts
|
import { PublicKey } from '@solana/web3.js';
import * as anchor from '@coral-xyz/anchor';
import { BN } from '@coral-xyz/anchor';
import { TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID } from '@solana/spl-token';
import { SpotMarketAccount } from '..';
export async function getDriftStateAccountPublicKeyAndNonce(
programId: PublicKey
): Promise<[PublicKey, number]> {
return PublicKey.findProgramAddress(
[Buffer.from(anchor.utils.bytes.utf8.encode('drift_state'))],
programId
);
}
export async function getDriftStateAccountPublicKey(
programId: PublicKey
): Promise<PublicKey> {
return (await getDriftStateAccountPublicKeyAndNonce(programId))[0];
}
export async function getUserAccountPublicKeyAndNonce(
programId: PublicKey,
authority: PublicKey,
subAccountId = 0
): Promise<[PublicKey, number]> {
return PublicKey.findProgramAddress(
[
Buffer.from(anchor.utils.bytes.utf8.encode('user')),
authority.toBuffer(),
new anchor.BN(subAccountId).toArrayLike(Buffer, 'le', 2),
],
programId
);
}
export async function getUserAccountPublicKey(
programId: PublicKey,
authority: PublicKey,
subAccountId = 0
): Promise<PublicKey> {
return (
await getUserAccountPublicKeyAndNonce(programId, authority, subAccountId)
)[0];
}
export function getUserAccountPublicKeySync(
programId: PublicKey,
authority: PublicKey,
subAccountId = 0
): PublicKey {
return PublicKey.findProgramAddressSync(
[
Buffer.from(anchor.utils.bytes.utf8.encode('user')),
authority.toBuffer(),
new anchor.BN(subAccountId).toArrayLike(Buffer, 'le', 2),
],
programId
)[0];
}
export function getUserStatsAccountPublicKey(
programId: PublicKey,
authority: PublicKey
): PublicKey {
return PublicKey.findProgramAddressSync(
[
Buffer.from(anchor.utils.bytes.utf8.encode('user_stats')),
authority.toBuffer(),
],
programId
)[0];
}
export function getRFQUserAccountPublicKey(
programId: PublicKey,
userAccountPublicKey: PublicKey
): PublicKey {
return PublicKey.findProgramAddressSync(
[
Buffer.from(anchor.utils.bytes.utf8.encode('RFQ')),
userAccountPublicKey.toBuffer(),
],
programId
)[0];
}
export function getSwiftUserAccountPublicKey(
programId: PublicKey,
userAccountPublicKey: PublicKey
): PublicKey {
return PublicKey.findProgramAddressSync(
[
Buffer.from(anchor.utils.bytes.utf8.encode('SWIFT')),
userAccountPublicKey.toBuffer(),
],
programId
)[0];
}
export async function getPerpMarketPublicKey(
programId: PublicKey,
marketIndex: number
): Promise<PublicKey> {
return (
await PublicKey.findProgramAddress(
[
Buffer.from(anchor.utils.bytes.utf8.encode('perp_market')),
new anchor.BN(marketIndex).toArrayLike(Buffer, 'le', 2),
],
programId
)
)[0];
}
export function getPerpMarketPublicKeySync(
programId: PublicKey,
marketIndex: number
): PublicKey {
return PublicKey.findProgramAddressSync(
[
Buffer.from(anchor.utils.bytes.utf8.encode('perp_market')),
new anchor.BN(marketIndex).toArrayLike(Buffer, 'le', 2),
],
programId
)[0];
}
export async function getSpotMarketPublicKey(
programId: PublicKey,
marketIndex: number
): Promise<PublicKey> {
return (
await PublicKey.findProgramAddress(
[
Buffer.from(anchor.utils.bytes.utf8.encode('spot_market')),
new anchor.BN(marketIndex).toArrayLike(Buffer, 'le', 2),
],
programId
)
)[0];
}
export function getSpotMarketPublicKeySync(
programId: PublicKey,
marketIndex: number
): PublicKey {
return PublicKey.findProgramAddressSync(
[
Buffer.from(anchor.utils.bytes.utf8.encode('spot_market')),
new anchor.BN(marketIndex).toArrayLike(Buffer, 'le', 2),
],
programId
)[0];
}
export async function getSpotMarketVaultPublicKey(
programId: PublicKey,
marketIndex: number
): Promise<PublicKey> {
return (
await PublicKey.findProgramAddress(
[
Buffer.from(anchor.utils.bytes.utf8.encode('spot_market_vault')),
new anchor.BN(marketIndex).toArrayLike(Buffer, 'le', 2),
],
programId
)
)[0];
}
export async function getInsuranceFundVaultPublicKey(
programId: PublicKey,
marketIndex: number
): Promise<PublicKey> {
return (
await PublicKey.findProgramAddress(
[
Buffer.from(anchor.utils.bytes.utf8.encode('insurance_fund_vault')),
new anchor.BN(marketIndex).toArrayLike(Buffer, 'le', 2),
],
programId
)
)[0];
}
export function getInsuranceFundStakeAccountPublicKey(
programId: PublicKey,
authority: PublicKey,
marketIndex: number
): PublicKey {
return PublicKey.findProgramAddressSync(
[
Buffer.from(anchor.utils.bytes.utf8.encode('insurance_fund_stake')),
authority.toBuffer(),
new anchor.BN(marketIndex).toArrayLike(Buffer, 'le', 2),
],
programId
)[0];
}
export function getDriftSignerPublicKey(programId: PublicKey): PublicKey {
return PublicKey.findProgramAddressSync(
[Buffer.from(anchor.utils.bytes.utf8.encode('drift_signer'))],
programId
)[0];
}
export function getSerumOpenOrdersPublicKey(
programId: PublicKey,
market: PublicKey
): PublicKey {
return PublicKey.findProgramAddressSync(
[
Buffer.from(anchor.utils.bytes.utf8.encode('serum_open_orders')),
market.toBuffer(),
],
programId
)[0];
}
export function getSerumSignerPublicKey(
programId: PublicKey,
market: PublicKey,
nonce: BN
): PublicKey {
return anchor.web3.PublicKey.createProgramAddressSync(
[market.toBuffer(), nonce.toArrayLike(Buffer, 'le', 8)],
programId
);
}
export function getSerumFulfillmentConfigPublicKey(
programId: PublicKey,
market: PublicKey
): PublicKey {
return PublicKey.findProgramAddressSync(
[
Buffer.from(anchor.utils.bytes.utf8.encode('serum_fulfillment_config')),
market.toBuffer(),
],
programId
)[0];
}
export function getPhoenixFulfillmentConfigPublicKey(
programId: PublicKey,
market: PublicKey
): PublicKey {
return PublicKey.findProgramAddressSync(
[
Buffer.from(anchor.utils.bytes.utf8.encode('phoenix_fulfillment_config')),
market.toBuffer(),
],
programId
)[0];
}
export function getOpenbookV2FulfillmentConfigPublicKey(
programId: PublicKey,
market: PublicKey
): PublicKey {
return PublicKey.findProgramAddressSync(
[
Buffer.from(
anchor.utils.bytes.utf8.encode('openbook_v2_fulfillment_config')
),
market.toBuffer(),
],
programId
)[0];
}
export function getReferrerNamePublicKeySync(
programId: PublicKey,
nameBuffer: number[]
): PublicKey {
return PublicKey.findProgramAddressSync(
[
Buffer.from(anchor.utils.bytes.utf8.encode('referrer_name')),
Buffer.from(nameBuffer),
],
programId
)[0];
}
export function getProtocolIfSharesTransferConfigPublicKey(
programId: PublicKey
): PublicKey {
return PublicKey.findProgramAddressSync(
[Buffer.from(anchor.utils.bytes.utf8.encode('if_shares_transfer_config'))],
programId
)[0];
}
export function getPrelaunchOraclePublicKey(
programId: PublicKey,
marketIndex: number
): PublicKey {
return PublicKey.findProgramAddressSync(
[
Buffer.from(anchor.utils.bytes.utf8.encode('prelaunch_oracle')),
new anchor.BN(marketIndex).toArrayLike(Buffer, 'le', 2),
],
programId
)[0];
}
export function getPythPullOraclePublicKey(
progarmId: PublicKey,
feedId: Uint8Array
): PublicKey {
return PublicKey.findProgramAddressSync(
[
Buffer.from(anchor.utils.bytes.utf8.encode('pyth_pull')),
Buffer.from(feedId),
],
progarmId
)[0];
}
export function getPythLazerOraclePublicKey(
progarmId: PublicKey,
feedId: number
): PublicKey {
const buffer = new ArrayBuffer(4);
const view = new DataView(buffer);
view.setUint32(0, feedId, true);
const feedIdBytes = new Uint8Array(buffer);
return PublicKey.findProgramAddressSync(
[
Buffer.from(anchor.utils.bytes.utf8.encode('pyth_lazer')),
Buffer.from(feedIdBytes),
],
progarmId
)[0];
}
export function getTokenProgramForSpotMarket(
spotMarketAccount: SpotMarketAccount
): PublicKey {
if (spotMarketAccount.tokenProgram === 1) {
return TOKEN_2022_PROGRAM_ID;
}
return TOKEN_PROGRAM_ID;
}
export function getHighLeverageModeConfigPublicKey(
programId: PublicKey
): PublicKey {
return PublicKey.findProgramAddressSync(
[Buffer.from(anchor.utils.bytes.utf8.encode('high_leverage_mode_config'))],
programId
)[0];
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/addresses/marketAddresses.ts
|
import { PublicKey } from '@solana/web3.js';
import { getPerpMarketPublicKey } from './pda';
const CACHE = new Map<string, PublicKey>();
export async function getMarketAddress(
programId: PublicKey,
marketIndex: number
): Promise<PublicKey> {
const cacheKey = `${programId.toString()}-${marketIndex.toString()}`;
if (CACHE.has(cacheKey)) {
return CACHE.get(cacheKey);
}
const publicKey = await getPerpMarketPublicKey(programId, marketIndex);
CACHE.set(cacheKey, publicKey);
return publicKey;
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/blockhashSubscriber/types.ts
|
import { Commitment, Connection } from '@solana/web3.js';
export type BlockhashSubscriberConfig = {
/// rpcUrl to poll block hashes from, one of rpcUrl or Connection must provided
rpcUrl?: string;
/// connection to poll block hashes from, one of rpcUrl or Connection must provided
connection?: Connection;
/// commitment to poll block hashes with, default is 'confirmed'
commitment?: Commitment;
/// interval to poll block hashes, default is 1000 ms
updateIntervalMs?: number;
};
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/blockhashSubscriber/index.ts
|
export * from './BlockhashSubscriber';
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/blockhashSubscriber/BlockhashSubscriber.ts
|
import {
BlockhashWithExpiryBlockHeight,
Commitment,
Connection,
Context,
} from '@solana/web3.js';
import { BlockhashSubscriberConfig } from './types';
export class BlockhashSubscriber {
private connection: Connection;
private isSubscribed = false;
private latestBlockHeight: number;
private latestBlockHeightContext: Context | undefined;
private blockhashes: Array<BlockhashWithExpiryBlockHeight> = [];
private updateBlockhashIntervalId: NodeJS.Timeout | undefined;
private commitment: Commitment;
private updateIntervalMs: number;
constructor(config: BlockhashSubscriberConfig) {
if (!config.connection && !config.rpcUrl) {
throw new Error(
'BlockhashSubscriber requires one of connection or rpcUrl must be provided'
);
}
this.connection = config.connection || new Connection(config.rpcUrl!);
this.commitment = config.commitment ?? 'confirmed';
this.updateIntervalMs = config.updateIntervalMs ?? 1000;
}
getBlockhashCacheSize(): number {
return this.blockhashes.length;
}
getLatestBlockHeight(): number {
return this.latestBlockHeight;
}
getLatestBlockHeightContext(): Context | undefined {
return this.latestBlockHeightContext;
}
/**
* Returns the latest cached blockhash, based on an offset from the latest obtained
* @param offset Offset to use, defaulting to 0
* @param offsetType If 'seconds', it will use calculate the actual element offset based on the update interval; otherwise it will return a fixed index
* @returns Cached blockhash at the given offset, or undefined
*/
getLatestBlockhash(
offset = 0,
offsetType: 'index' | 'seconds' = 'index'
): BlockhashWithExpiryBlockHeight | undefined {
if (this.blockhashes.length === 0) {
return undefined;
}
const elementOffset =
offsetType == 'seconds'
? Math.floor((offset * 1000) / this.updateIntervalMs)
: offset;
const clampedOffset = Math.max(
0,
Math.min(this.blockhashes.length - 1, elementOffset)
);
return this.blockhashes[this.blockhashes.length - 1 - clampedOffset];
}
pruneBlockhashes() {
if (this.latestBlockHeight) {
this.blockhashes = this.blockhashes.filter(
(blockhash) => blockhash.lastValidBlockHeight > this.latestBlockHeight!
);
}
}
async updateBlockhash() {
try {
const [resp, lastConfirmedBlockHeight] = await Promise.all([
this.connection.getLatestBlockhashAndContext({
commitment: this.commitment,
}),
this.connection.getBlockHeight({ commitment: this.commitment }),
]);
this.latestBlockHeight = lastConfirmedBlockHeight;
this.latestBlockHeightContext = resp.context;
// avoid caching duplicate blockhashes
if (this.blockhashes.length > 0) {
if (
resp.value.blockhash ===
this.blockhashes[this.blockhashes.length - 1].blockhash
) {
return;
}
}
this.blockhashes.push(resp.value);
} catch (e) {
console.error('Error updating blockhash:\n', e);
} finally {
this.pruneBlockhashes();
}
}
async subscribe() {
if (this.isSubscribed) {
return;
}
this.isSubscribed = true;
await this.updateBlockhash();
this.updateBlockhashIntervalId = setInterval(
this.updateBlockhash.bind(this),
this.updateIntervalMs
);
}
unsubscribe() {
if (this.updateBlockhashIntervalId) {
clearInterval(this.updateBlockhashIntervalId);
this.updateBlockhashIntervalId = undefined;
}
this.isSubscribed = false;
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/slot/SlotSubscriber.ts
|
import { Connection } from '@solana/web3.js';
import { EventEmitter } from 'events';
import StrictEventEmitter from 'strict-event-emitter-types/types/src';
// eslint-disable-next-line @typescript-eslint/ban-types
type SlotSubscriberConfig = {
resubTimeoutMs?: number;
}; // for future customization
export interface SlotSubscriberEvents {
newSlot: (newSlot: number) => void;
}
export class SlotSubscriber {
currentSlot: number;
subscriptionId: number;
eventEmitter: StrictEventEmitter<EventEmitter, SlotSubscriberEvents>;
// Reconnection
timeoutId?: NodeJS.Timeout;
resubTimeoutMs?: number;
isUnsubscribing = false;
receivingData = false;
public constructor(
private connection: Connection,
config?: SlotSubscriberConfig
) {
this.eventEmitter = new EventEmitter();
this.resubTimeoutMs = config?.resubTimeoutMs;
if (this.resubTimeoutMs < 1000) {
console.log(
'resubTimeoutMs should be at least 1000ms to avoid spamming resub'
);
}
}
public async subscribe(): Promise<void> {
if (this.subscriptionId != null) {
return;
}
this.currentSlot = await this.connection.getSlot('confirmed');
this.subscriptionId = this.connection.onSlotChange((slotInfo) => {
if (!this.currentSlot || this.currentSlot < slotInfo.slot) {
if (this.resubTimeoutMs && !this.isUnsubscribing) {
this.receivingData = true;
clearTimeout(this.timeoutId);
this.setTimeout();
}
this.currentSlot = slotInfo.slot;
this.eventEmitter.emit('newSlot', slotInfo.slot);
}
});
if (this.resubTimeoutMs) {
this.receivingData = true;
this.setTimeout();
}
}
private setTimeout(): void {
this.timeoutId = setTimeout(async () => {
if (this.isUnsubscribing) {
// If we are in the process of unsubscribing, do not attempt to resubscribe
return;
}
if (this.receivingData) {
console.log(
`No new slot in ${this.resubTimeoutMs}ms, slot subscriber resubscribing`
);
await this.unsubscribe(true);
this.receivingData = false;
await this.subscribe();
}
}, this.resubTimeoutMs);
}
public getSlot(): number {
return this.currentSlot;
}
public async unsubscribe(onResub = false): Promise<void> {
if (!onResub) {
this.resubTimeoutMs = undefined;
}
this.isUnsubscribing = true;
clearTimeout(this.timeoutId);
this.timeoutId = undefined;
if (this.subscriptionId != null) {
await this.connection.removeSlotChangeListener(this.subscriptionId);
this.subscriptionId = undefined;
this.isUnsubscribing = false;
} else {
this.isUnsubscribing = false;
}
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/slot/SlothashSubscriber.ts
|
import {
Commitment,
Connection,
SYSVAR_SLOT_HASHES_PUBKEY,
} from '@solana/web3.js';
import { bs58 } from '@coral-xyz/anchor/dist/cjs/utils/bytes';
import { BN } from '@coral-xyz/anchor';
// eslint-disable-next-line @typescript-eslint/ban-types
type SlothashSubscriberConfig = {
resubTimeoutMs?: number;
commitment?: Commitment;
}; // for future customization
export type Slothash = {
slot: number;
hash: string;
};
export class SlothashSubscriber {
currentSlothash: Slothash;
subscriptionId: number;
commitment: Commitment;
// Reconnection
timeoutId?: NodeJS.Timeout;
resubTimeoutMs?: number;
isUnsubscribing = false;
receivingData = false;
public constructor(
private connection: Connection,
config?: SlothashSubscriberConfig
) {
this.resubTimeoutMs = config?.resubTimeoutMs;
this.commitment = config?.commitment ?? 'processed';
if (this.resubTimeoutMs < 1000) {
console.log(
'resubTimeoutMs should be at least 1000ms to avoid spamming resub'
);
}
}
public async subscribe(): Promise<void> {
if (this.subscriptionId != null) {
return;
}
const currentAccountData = await this.connection.getAccountInfo(
SYSVAR_SLOT_HASHES_PUBKEY,
this.commitment
);
if (currentAccountData == null) {
throw new Error('Failed to retrieve current slot hash');
}
this.currentSlothash = deserializeSlothash(currentAccountData.data);
this.subscriptionId = this.connection.onAccountChange(
SYSVAR_SLOT_HASHES_PUBKEY,
(slothashInfo, context) => {
if (!this.currentSlothash || this.currentSlothash.slot < context.slot) {
if (this.resubTimeoutMs && !this.isUnsubscribing) {
this.receivingData = true;
clearTimeout(this.timeoutId);
this.setTimeout();
}
this.currentSlothash = deserializeSlothash(slothashInfo.data);
}
},
this.commitment
);
if (this.resubTimeoutMs) {
this.receivingData = true;
this.setTimeout();
}
}
private setTimeout(): void {
this.timeoutId = setTimeout(async () => {
if (this.isUnsubscribing) {
// If we are in the process of unsubscribing, do not attempt to resubscribe
return;
}
if (this.receivingData) {
console.log(
`No new slot in ${this.resubTimeoutMs}ms, slot subscriber resubscribing`
);
await this.unsubscribe(true);
this.receivingData = false;
await this.subscribe();
}
}, this.resubTimeoutMs);
}
public getSlothash(): Slothash {
return this.currentSlothash;
}
public async unsubscribe(onResub = false): Promise<void> {
if (!onResub) {
this.resubTimeoutMs = undefined;
}
this.isUnsubscribing = true;
clearTimeout(this.timeoutId);
this.timeoutId = undefined;
if (this.subscriptionId != null) {
await this.connection.removeSlotChangeListener(this.subscriptionId);
this.subscriptionId = undefined;
this.isUnsubscribing = false;
} else {
this.isUnsubscribing = false;
}
}
}
function deserializeSlothash(data: Buffer): Slothash {
const slotNumber = new BN(data.subarray(8, 16), 10, 'le');
const hash = bs58.encode(data.subarray(16, 48));
return {
slot: slotNumber.toNumber(),
hash,
};
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/serum/serumFulfillmentConfigMap.ts
|
import { PublicKey } from '@solana/web3.js';
import { SerumV3FulfillmentConfigAccount } from '../types';
import { DriftClient } from '../driftClient';
export class SerumFulfillmentConfigMap {
driftClient: DriftClient;
map = new Map<number, SerumV3FulfillmentConfigAccount>();
public constructor(driftClient: DriftClient) {
this.driftClient = driftClient;
}
public async add(
marketIndex: number,
serumMarketAddress: PublicKey
): Promise<void> {
const account = await this.driftClient.getSerumV3FulfillmentConfig(
serumMarketAddress
);
this.map.set(marketIndex, account);
}
public get(marketIndex: number): SerumV3FulfillmentConfigAccount {
return this.map.get(marketIndex);
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/serum/serumSubscriber.ts
|
import { Connection, PublicKey } from '@solana/web3.js';
import { BulkAccountLoader } from '../accounts/bulkAccountLoader';
import { Market, Orderbook } from '@project-serum/serum';
import { SerumMarketSubscriberConfig } from './types';
import { BN } from '@coral-xyz/anchor';
import { PRICE_PRECISION } from '../constants/numericConstants';
import { L2Level, L2OrderBookGenerator } from '../dlob/orderBookLevels';
export class SerumSubscriber implements L2OrderBookGenerator {
connection: Connection;
programId: PublicKey;
marketAddress: PublicKey;
subscriptionType: 'polling' | 'websocket';
accountLoader: BulkAccountLoader | undefined;
market: Market;
subscribed: boolean;
asksAddress: PublicKey;
asks: Orderbook;
asksCallbackId: string | number;
lastAsksSlot: number;
bidsAddress: PublicKey;
bids: Orderbook;
bidsCallbackId: string | number;
lastBidsSlot: number;
public constructor(config: SerumMarketSubscriberConfig) {
this.connection = config.connection;
this.programId = config.programId;
this.marketAddress = config.marketAddress;
if (config.accountSubscription.type === 'polling') {
this.subscriptionType = 'polling';
this.accountLoader = config.accountSubscription.accountLoader;
} else {
this.subscriptionType = 'websocket';
}
}
public async subscribe(): Promise<void> {
if (this.subscribed) {
return;
}
this.market = await Market.load(
this.connection,
this.marketAddress,
undefined,
this.programId
);
this.asksAddress = this.market.asksAddress;
this.asks = await this.market.loadAsks(this.connection);
if (this.subscriptionType === 'websocket') {
this.asksCallbackId = this.connection.onAccountChange(
this.asksAddress,
(accountInfo, ctx) => {
this.lastAsksSlot = ctx.slot;
this.asks = Orderbook.decode(this.market, accountInfo.data);
}
);
} else {
this.asksCallbackId = await this.accountLoader.addAccount(
this.asksAddress,
(buffer, slot) => {
this.lastAsksSlot = slot;
this.asks = Orderbook.decode(this.market, buffer);
}
);
}
this.bidsAddress = this.market.bidsAddress;
this.bids = await this.market.loadBids(this.connection);
if (this.subscriptionType === 'websocket') {
this.bidsCallbackId = this.connection.onAccountChange(
this.bidsAddress,
(accountInfo, ctx) => {
this.lastBidsSlot = ctx.slot;
this.bids = Orderbook.decode(this.market, accountInfo.data);
}
);
} else {
this.bidsCallbackId = await this.accountLoader.addAccount(
this.bidsAddress,
(buffer, slot) => {
this.lastBidsSlot = slot;
this.bids = Orderbook.decode(this.market, buffer);
}
);
}
this.subscribed = true;
}
public getBestBid(): BN | undefined {
const bestBid = this.bids.getL2(1)[0];
if (!bestBid) {
return undefined;
}
return new BN(bestBid[0] * PRICE_PRECISION.toNumber());
}
public getBestAsk(): BN | undefined {
const bestAsk = this.asks.getL2(1)[0];
if (!bestAsk) {
return undefined;
}
return new BN(bestAsk[0] * PRICE_PRECISION.toNumber());
}
public getL2Bids(): Generator<L2Level> {
return this.getL2Levels('bids');
}
public getL2Asks(): Generator<L2Level> {
return this.getL2Levels('asks');
}
*getL2Levels(side: 'bids' | 'asks'): Generator<L2Level> {
// @ts-ignore
const basePrecision = Math.pow(10, this.market._baseSplTokenDecimals);
const pricePrecision = PRICE_PRECISION.toNumber();
for (const { price: priceNum, size: sizeNum } of this[side].items(
side === 'bids'
)) {
const price = new BN(priceNum * pricePrecision);
const size = new BN(sizeNum * basePrecision);
yield {
price,
size,
sources: {
serum: size,
},
};
}
}
public async unsubscribe(): Promise<void> {
if (!this.subscribed) {
return;
}
// remove listeners
if (this.subscriptionType === 'websocket') {
await this.connection.removeAccountChangeListener(
this.asksCallbackId as number
);
await this.connection.removeAccountChangeListener(
this.bidsCallbackId as number
);
} else {
this.accountLoader.removeAccount(
this.asksAddress,
this.asksCallbackId as string
);
this.accountLoader.removeAccount(
this.bidsAddress,
this.bidsCallbackId as string
);
}
this.subscribed = false;
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/serum/types.ts
|
import { Connection, PublicKey } from '@solana/web3.js';
import { BulkAccountLoader } from '../accounts/bulkAccountLoader';
export type SerumMarketSubscriberConfig = {
connection: Connection;
programId: PublicKey;
marketAddress: PublicKey;
accountSubscription:
| {
// enables use to add web sockets in the future
type: 'polling';
accountLoader: BulkAccountLoader;
}
| {
type: 'websocket';
};
};
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/events/eventList.ts
|
import {
EventType,
EventMap,
EventSubscriptionOrderDirection,
SortFn,
} from './types';
class Node<Type extends EventType, Event extends EventMap[Type]> {
constructor(
public event: Event,
public next?: Node<Type, Event>,
public prev?: Node<Type, Event>
) {}
}
export class EventList<Type extends EventType> {
size = 0;
head?: Node<Type, EventMap[Type]>;
tail?: Node<Type, EventMap[Type]>;
public constructor(
public eventType: Type,
public maxSize: number,
private sortFn: SortFn,
private orderDirection: EventSubscriptionOrderDirection
) {}
public insert(event: EventMap[Type]): void {
this.size++;
const newNode = new Node(event);
if (this.head === undefined) {
this.head = this.tail = newNode;
return;
}
if (
this.sortFn(this.head.event, newNode.event) ===
(this.orderDirection === 'asc' ? 'less than' : 'greater than')
) {
this.head.prev = newNode;
newNode.next = this.head;
this.head = newNode;
} else {
let currentNode = this.head;
while (
currentNode.next !== undefined &&
this.sortFn(currentNode.next.event, newNode.event) !==
(this.orderDirection === 'asc' ? 'less than' : 'greater than')
) {
currentNode = currentNode.next;
}
newNode.next = currentNode.next;
if (currentNode.next !== undefined) {
newNode.next.prev = newNode;
} else {
this.tail = newNode;
}
currentNode.next = newNode;
newNode.prev = currentNode;
}
if (this.size > this.maxSize) {
this.detach();
}
}
detach(): void {
const node = this.tail;
if (node.prev !== undefined) {
node.prev.next = node.next;
} else {
this.head = node.next;
}
if (node.next !== undefined) {
node.next.prev = node.prev;
} else {
this.tail = node.prev;
}
this.size--;
}
toArray(): EventMap[Type][] {
return Array.from(this);
}
*[Symbol.iterator]() {
let node = this.head;
while (node) {
yield node.event;
node = node.next;
}
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/events/webSocketLogProvider.ts
|
import { LogProvider, logProviderCallback } from './types';
import {
Commitment,
Connection,
Context,
Logs,
PublicKey,
} from '@solana/web3.js';
import { EventEmitter } from 'events';
export class WebSocketLogProvider implements LogProvider {
private subscriptionId: number;
private isUnsubscribing = false;
private externalUnsubscribe = false;
private receivingData = false;
private timeoutId?: NodeJS.Timeout;
private reconnectAttempts = 0;
eventEmitter?: EventEmitter;
private callback?: logProviderCallback;
public constructor(
private connection: Connection,
private address: PublicKey,
private commitment: Commitment,
private resubTimeoutMs?: number
) {
if (this.resubTimeoutMs) {
this.eventEmitter = new EventEmitter();
}
}
public async subscribe(callback: logProviderCallback): Promise<boolean> {
if (this.subscriptionId != null) {
return true;
}
this.callback = callback;
try {
this.setSubscription(callback);
} catch (error) {
// Sometimes ws connection isn't ready, give it a few secs
setTimeout(() => this.setSubscription(callback), 2000);
}
if (this.resubTimeoutMs) {
this.setTimeout();
}
return true;
}
public setSubscription(callback: logProviderCallback): void {
this.subscriptionId = this.connection.onLogs(
this.address,
(logs: Logs, ctx: Context) => {
if (this.resubTimeoutMs && !this.isUnsubscribing) {
this.receivingData = true;
clearTimeout(this.timeoutId);
this.setTimeout();
if (this.reconnectAttempts > 0) {
console.log('Resetting reconnect attempts to 0');
}
this.reconnectAttempts = 0;
}
if (logs.err !== null) {
return;
}
callback(logs.signature, ctx.slot, logs.logs, undefined, undefined);
},
this.commitment
);
}
public isSubscribed(): boolean {
return this.subscriptionId != null;
}
public async unsubscribe(external = false): Promise<boolean> {
this.isUnsubscribing = true;
this.externalUnsubscribe = external;
clearTimeout(this.timeoutId);
this.timeoutId = undefined;
if (this.subscriptionId != null) {
try {
await this.connection.removeOnLogsListener(this.subscriptionId);
this.subscriptionId = undefined;
this.isUnsubscribing = false;
return true;
} catch (err) {
console.log('Error unsubscribing from logs: ', err);
this.isUnsubscribing = false;
return false;
}
} else {
this.isUnsubscribing = false;
return true;
}
}
private setTimeout(): void {
this.timeoutId = setTimeout(async () => {
if (this.isUnsubscribing || this.externalUnsubscribe) {
// If we are in the process of unsubscribing, do not attempt to resubscribe
return;
}
if (this.receivingData) {
console.log(
`webSocketLogProvider: No log data in ${
this.resubTimeoutMs
}ms, resubscribing on attempt ${this.reconnectAttempts + 1}`
);
await this.unsubscribe();
this.receivingData = false;
this.reconnectAttempts++;
this.eventEmitter.emit('reconnect', this.reconnectAttempts);
this.subscribe(this.callback);
}
}, this.resubTimeoutMs);
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/events/pollingLogProvider.ts
|
import { LogProvider, logProviderCallback } from './types';
import {
Commitment,
Connection,
Finality,
PublicKey,
TransactionSignature,
} from '@solana/web3.js';
import { fetchLogs } from './fetchLogs';
export class PollingLogProvider implements LogProvider {
private finality: Finality;
private intervalId: ReturnType<typeof setTimeout>;
private mostRecentSeenTx?: TransactionSignature;
private mutex: number;
private firstFetch = true;
public constructor(
private connection: Connection,
private address: PublicKey,
commitment: Commitment,
private frequency = 15 * 1000,
private batchSize?: number
) {
this.finality = commitment === 'finalized' ? 'finalized' : 'confirmed';
}
public async subscribe(
callback: logProviderCallback,
skipHistory?: boolean
): Promise<boolean> {
if (this.intervalId) {
return true;
}
this.intervalId = setInterval(async () => {
if (this.mutex === 1) {
return;
}
this.mutex = 1;
try {
const response = await fetchLogs(
this.connection,
this.address,
this.finality,
undefined,
this.mostRecentSeenTx,
// If skipping history, only fetch one log back, not the maximum amount available
skipHistory && this.firstFetch ? 1 : undefined,
this.batchSize
);
if (response === undefined) {
return;
}
this.firstFetch = false;
const { mostRecentTx, transactionLogs } = response;
for (const { txSig, slot, logs } of transactionLogs) {
callback(txSig, slot, logs, response.mostRecentBlockTime, undefined);
}
this.mostRecentSeenTx = mostRecentTx;
} catch (e) {
console.error('PollingLogProvider threw an Error');
console.error(e);
} finally {
this.mutex = 0;
}
}, this.frequency);
return true;
}
public isSubscribed(): boolean {
return this.intervalId !== undefined;
}
public async unsubscribe(): Promise<boolean> {
if (this.intervalId !== undefined) {
clearInterval(this.intervalId);
this.intervalId = undefined;
}
return true;
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/events/parse.ts
|
import { Program, Event } from '@coral-xyz/anchor';
const driftProgramId = 'dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH';
const PROGRAM_LOG = 'Program log: ';
const PROGRAM_DATA = 'Program data: ';
const PROGRAM_LOG_START_INDEX = PROGRAM_LOG.length;
const PROGRAM_DATA_START_INDEX = PROGRAM_DATA.length;
export function parseLogs(
program: Program,
logs: string[],
programId = driftProgramId
): Event[] {
const { events } = parseLogsWithRaw(program, logs, programId);
return events;
}
export function parseLogsWithRaw(
program: Program,
logs: string[],
programId = driftProgramId
): { events: Event[]; rawLogs: string[] } {
const events = [];
const rawLogs = [];
const execution = new ExecutionContext();
for (const log of logs) {
if (log.startsWith('Log truncated')) {
break;
}
const [event, newProgram, didPop] = handleLog(
execution,
log,
program,
programId
);
if (event) {
events.push(event);
rawLogs.push(log);
}
if (newProgram) {
execution.push(newProgram);
}
if (didPop) {
execution.pop();
}
}
return { events, rawLogs };
}
function handleLog(
execution: ExecutionContext,
log: string,
program: Program,
programId = driftProgramId
): [Event | null, string | null, boolean] {
// Executing program is drift program.
if (execution.stack.length > 0 && execution.program() === programId) {
return handleProgramLog(log, program, programId);
}
// Executing program is not drift program.
else {
return [null, ...handleSystemLog(log, programId)];
}
}
// Handles logs from *drift* program.
function handleProgramLog(
log: string,
program: Program,
programId = driftProgramId
): [Event | null, string | null, boolean] {
// This is a `msg!` log or a `sol_log_data` log.
if (log.startsWith(PROGRAM_LOG)) {
const logStr = log.slice(PROGRAM_LOG_START_INDEX);
const event = program.coder.events.decode(logStr);
return [event, null, false];
} else if (log.startsWith(PROGRAM_DATA)) {
const logStr = log.slice(PROGRAM_DATA_START_INDEX);
const event = program.coder.events.decode(logStr);
return [event, null, false];
} else {
return [null, ...handleSystemLog(log, programId)];
}
}
// Handles logs when the current program being executing is *not* drift.
function handleSystemLog(
log: string,
programId = driftProgramId
): [string | null, boolean] {
// System component.
const logStart = log.split(':')[0];
const programStart = `Program ${programId} invoke`;
// Did the program finish executing?
if (logStart.match(/^Program (.*) success/g) !== null) {
return [null, true];
// Recursive call.
} else if (logStart.startsWith(programStart)) {
return [programId, false];
}
// CPI call.
else if (logStart.includes('invoke')) {
return ['cpi', false]; // Any string will do.
} else {
return [null, false];
}
}
// Stack frame execution context, allowing one to track what program is
// executing for a given log.
class ExecutionContext {
stack: string[] = [];
program(): string {
if (!this.stack.length) {
throw new Error('Expected the stack to have elements');
}
return this.stack[this.stack.length - 1];
}
push(newProgram: string) {
this.stack.push(newProgram);
}
pop() {
if (!this.stack.length) {
throw new Error('Expected the stack to have elements');
}
this.stack.pop();
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/events/fetchLogs.ts
|
import { Program } from '@coral-xyz/anchor';
import {
Connection,
Finality,
PublicKey,
TransactionResponse,
TransactionSignature,
VersionedTransactionResponse,
} from '@solana/web3.js';
import { WrappedEvents } from './types';
import { promiseTimeout } from '../util/promiseTimeout';
import { parseLogs } from './parse';
type Log = { txSig: TransactionSignature; slot: number; logs: string[] };
type FetchLogsResponse = {
earliestTx: string;
mostRecentTx: string;
earliestSlot: number;
mostRecentSlot: number;
transactionLogs: Log[];
mostRecentBlockTime: number | undefined;
};
function mapTransactionResponseToLog(
transaction: TransactionResponse | VersionedTransactionResponse
): Log {
return {
txSig: transaction.transaction.signatures[0],
slot: transaction.slot,
logs: transaction.meta.logMessages,
};
}
export async function fetchLogs(
connection: Connection,
address: PublicKey,
finality: Finality,
beforeTx?: TransactionSignature,
untilTx?: TransactionSignature,
limit?: number,
batchSize = 25
): Promise<FetchLogsResponse> {
const signatures = await connection.getSignaturesForAddress(
address,
{
before: beforeTx,
until: untilTx,
limit,
},
finality
);
const sortedSignatures = signatures.sort((a, b) =>
a.slot === b.slot ? 0 : a.slot < b.slot ? -1 : 1
);
const filteredSignatures = sortedSignatures.filter(
(signature) => !signature.err
);
if (filteredSignatures.length === 0) {
return undefined;
}
const chunkedSignatures = chunk(filteredSignatures, batchSize);
const transactionLogs = (
await Promise.all(
chunkedSignatures.map(async (chunk) => {
return await fetchTransactionLogs(
connection,
chunk.map((confirmedSignature) => confirmedSignature.signature),
finality
);
})
)
).flat();
const earliest = filteredSignatures[0];
const mostRecent = filteredSignatures[filteredSignatures.length - 1];
return {
transactionLogs: transactionLogs,
earliestTx: earliest.signature,
mostRecentTx: mostRecent.signature,
earliestSlot: earliest.slot,
mostRecentSlot: mostRecent.slot,
mostRecentBlockTime: mostRecent.blockTime,
};
}
export async function fetchTransactionLogs(
connection: Connection,
signatures: TransactionSignature[],
finality: Finality
): Promise<Log[]> {
const requests = new Array<{ methodName: string; args: any }>();
for (const signature of signatures) {
const args = [
signature,
{ commitment: finality, maxSupportedTransactionVersion: 0 },
];
requests.push({
methodName: 'getTransaction',
args,
});
}
const rpcResponses: any | null = await promiseTimeout(
// @ts-ignore
connection._rpcBatchRequest(requests),
10 * 1000 // 10 second timeout
);
if (rpcResponses === null) {
return Promise.reject('RPC request timed out fetching transactions');
}
const logs = new Array<Log>();
for (const rpcResponse of rpcResponses) {
if (rpcResponse.result) {
logs.push(mapTransactionResponseToLog(rpcResponse.result));
}
}
return logs;
}
function chunk<T>(array: readonly T[], size: number): T[][] {
return new Array(Math.ceil(array.length / size))
.fill(null)
.map((_, index) => index * size)
.map((begin) => array.slice(begin, begin + size));
}
export class LogParser {
private program: Program;
constructor(program: Program) {
this.program = program;
}
public parseEventsFromTransaction(
transaction: TransactionResponse
): WrappedEvents {
const transactionLogObject = mapTransactionResponseToLog(transaction);
return this.parseEventsFromLogs(transactionLogObject);
}
public parseEventsFromLogs(event: Log): WrappedEvents {
const records: WrappedEvents = [];
if (!event.logs) return records;
let runningEventIndex = 0;
for (const eventLog of parseLogs(this.program, event.logs)) {
eventLog.data.txSig = event.txSig;
eventLog.data.slot = event.slot;
eventLog.data.eventType = eventLog.name;
eventLog.data.txSigIndex = runningEventIndex;
// @ts-ignore
records.push(eventLog.data);
runningEventIndex++;
}
return records;
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/events/types.ts
|
import { Commitment, PublicKey, TransactionSignature } from '@solana/web3.js';
import {
DepositRecord,
FundingPaymentRecord,
FundingRateRecord,
LiquidationRecord,
NewUserRecord,
OrderActionRecord,
OrderRecord,
SettlePnlRecord,
LPRecord,
InsuranceFundRecord,
SpotInterestRecord,
InsuranceFundStakeRecord,
CurveRecord,
SwapRecord,
SpotMarketVaultDepositRecord,
SwiftOrderRecord,
DeleteUserRecord,
} from '../index';
import { EventEmitter } from 'events';
export type EventSubscriptionOptions = {
address?: PublicKey;
eventTypes?: EventType[];
maxEventsPerType?: number;
orderBy?: EventSubscriptionOrderBy;
orderDir?: EventSubscriptionOrderDirection;
commitment?: Commitment;
maxTx?: number;
logProviderConfig?: LogProviderConfig;
// when the subscription starts, client might want to backtrack and fetch old tx's
// this specifies how far to backtrack
untilTx?: TransactionSignature;
};
export const DefaultEventSubscriptionOptions: EventSubscriptionOptions = {
eventTypes: [
'DepositRecord',
'FundingPaymentRecord',
'LiquidationRecord',
'OrderRecord',
'OrderActionRecord',
'FundingRateRecord',
'NewUserRecord',
'SettlePnlRecord',
'LPRecord',
'InsuranceFundRecord',
'SpotInterestRecord',
'InsuranceFundStakeRecord',
'CurveRecord',
'SwapRecord',
'SpotMarketVaultDepositRecord',
'SwiftOrderRecord',
'DeleteUserRecord',
],
maxEventsPerType: 4096,
orderBy: 'blockchain',
orderDir: 'asc',
commitment: 'confirmed',
maxTx: 4096,
logProviderConfig: {
type: 'websocket',
},
};
// Whether we sort events based on order blockchain produced events or client receives events
export type EventSubscriptionOrderBy = 'blockchain' | 'client';
export type EventSubscriptionOrderDirection = 'asc' | 'desc';
export type Event<T> = T & {
txSig: TransactionSignature;
slot: number;
txSigIndex: number; // Unique index for each event inside a tx
};
export type WrappedEvent<Type extends EventType> = EventMap[Type] & {
eventType: Type;
};
export type WrappedEvents = WrappedEvent<EventType>[];
export type EventMap = {
DepositRecord: Event<DepositRecord>;
FundingPaymentRecord: Event<FundingPaymentRecord>;
LiquidationRecord: Event<LiquidationRecord>;
FundingRateRecord: Event<FundingRateRecord>;
OrderRecord: Event<OrderRecord>;
OrderActionRecord: Event<OrderActionRecord>;
SettlePnlRecord: Event<SettlePnlRecord>;
NewUserRecord: Event<NewUserRecord>;
LPRecord: Event<LPRecord>;
InsuranceFundRecord: Event<InsuranceFundRecord>;
SpotInterestRecord: Event<SpotInterestRecord>;
InsuranceFundStakeRecord: Event<InsuranceFundStakeRecord>;
CurveRecord: Event<CurveRecord>;
SwapRecord: Event<SwapRecord>;
SpotMarketVaultDepositRecord: Event<SpotMarketVaultDepositRecord>;
SwiftOrderRecord: Event<SwiftOrderRecord>;
DeleteUserRecord: Event<DeleteUserRecord>;
};
export type EventType = keyof EventMap;
export type DriftEvent =
| Event<DepositRecord>
| Event<FundingPaymentRecord>
| Event<LiquidationRecord>
| Event<FundingRateRecord>
| Event<OrderRecord>
| Event<OrderActionRecord>
| Event<SettlePnlRecord>
| Event<NewUserRecord>
| Event<LPRecord>
| Event<InsuranceFundRecord>
| Event<SpotInterestRecord>
| Event<InsuranceFundStakeRecord>
| Event<CurveRecord>
| Event<SwapRecord>
| Event<SpotMarketVaultDepositRecord>
| Event<SwiftOrderRecord>
| Event<DeleteUserRecord>;
export interface EventSubscriberEvents {
newEvent: (event: WrappedEvent<EventType>) => void;
}
export type SortFn = (
currentRecord: EventMap[EventType],
newRecord: EventMap[EventType]
) => 'less than' | 'greater than';
export type logProviderCallback = (
txSig: TransactionSignature,
slot: number,
logs: string[],
mostRecentBlockTime: number | undefined,
txSigIndex: number | undefined
) => void;
export interface LogProvider {
isSubscribed(): boolean;
subscribe(
callback: logProviderCallback,
skipHistory?: boolean
): Promise<boolean>;
unsubscribe(external?: boolean): Promise<boolean>;
eventEmitter?: EventEmitter;
}
export type LogProviderType = 'websocket' | 'polling' | 'events-server';
export type StreamingLogProviderConfig = {
/// Max number of times to try reconnecting before failing over to fallback provider
maxReconnectAttempts?: number;
/// used for PollingLogProviderConfig on fallback
fallbackFrequency?: number;
/// used for PollingLogProviderConfig on fallback
fallbackBatchSize?: number;
};
export type WebSocketLogProviderConfig = StreamingLogProviderConfig & {
type: 'websocket';
/// Max time to wait before resubscribing
resubTimeoutMs?: number;
};
export type PollingLogProviderConfig = {
type: 'polling';
/// frequency to poll for new events
frequency: number;
/// max number of events to fetch per poll
batchSize?: number;
};
export type EventsServerLogProviderConfig = StreamingLogProviderConfig & {
type: 'events-server';
/// url of the events server
url: string;
};
export type LogProviderConfig =
| WebSocketLogProviderConfig
| PollingLogProviderConfig
| EventsServerLogProviderConfig;
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/events/eventSubscriber.ts
|
import { Connection, PublicKey, TransactionSignature } from '@solana/web3.js';
import { Program } from '@coral-xyz/anchor';
import {
DefaultEventSubscriptionOptions,
EventSubscriptionOptions,
EventType,
WrappedEvents,
EventMap,
LogProvider,
EventSubscriberEvents,
WebSocketLogProviderConfig,
EventsServerLogProviderConfig,
LogProviderType,
StreamingLogProviderConfig,
PollingLogProviderConfig,
} from './types';
import { TxEventCache } from './txEventCache';
import { EventList } from './eventList';
import { PollingLogProvider } from './pollingLogProvider';
import { fetchLogs } from './fetchLogs';
import { WebSocketLogProvider } from './webSocketLogProvider';
import { EventEmitter } from 'events';
import StrictEventEmitter from 'strict-event-emitter-types';
import { getSortFn } from './sort';
import { parseLogs } from './parse';
import { EventsServerLogProvider } from './eventsServerLogProvider';
export class EventSubscriber {
private address: PublicKey;
private eventListMap: Map<EventType, EventList<EventType>>;
private txEventCache: TxEventCache;
private awaitTxPromises = new Map<string, Promise<void>>();
private awaitTxResolver = new Map<string, () => void>();
private logProvider: LogProvider;
private currentProviderType: LogProviderType;
public eventEmitter: StrictEventEmitter<EventEmitter, EventSubscriberEvents>;
private lastSeenSlot: number;
private lastSeenBlockTime: number | undefined;
public lastSeenTxSig: string;
public constructor(
private connection: Connection,
private program: Program,
private options: EventSubscriptionOptions = DefaultEventSubscriptionOptions
) {
this.options = Object.assign({}, DefaultEventSubscriptionOptions, options);
this.address = this.options.address ?? program.programId;
this.txEventCache = new TxEventCache(this.options.maxTx);
this.eventListMap = new Map<EventType, EventList<EventType>>();
this.eventEmitter = new EventEmitter();
this.currentProviderType = this.options.logProviderConfig.type;
this.initializeLogProvider();
}
private initializeLogProvider(subscribe = false) {
const logProviderConfig = this.options.logProviderConfig;
if (this.currentProviderType === 'websocket') {
this.logProvider = new WebSocketLogProvider(
// @ts-ignore
this.connection,
this.address,
this.options.commitment,
(
this.options.logProviderConfig as WebSocketLogProviderConfig
).resubTimeoutMs
);
} else if (this.currentProviderType === 'polling') {
const frequency =
'frequency' in logProviderConfig
? (logProviderConfig as PollingLogProviderConfig).frequency
: (logProviderConfig as StreamingLogProviderConfig).fallbackFrequency;
const batchSize =
'batchSize' in logProviderConfig
? (logProviderConfig as PollingLogProviderConfig).batchSize
: (logProviderConfig as StreamingLogProviderConfig).fallbackBatchSize;
this.logProvider = new PollingLogProvider(
// @ts-ignore
this.connection,
this.address,
this.options.commitment,
frequency,
batchSize
);
} else if (this.currentProviderType === 'events-server') {
this.logProvider = new EventsServerLogProvider(
(logProviderConfig as EventsServerLogProviderConfig).url,
this.options.eventTypes,
this.options.address ? this.options.address.toString() : undefined
);
} else {
throw new Error(`Invalid log provider type: ${this.currentProviderType}`);
}
if (subscribe) {
this.logProvider.subscribe(
(txSig, slot, logs, mostRecentBlockTime, txSigIndex) => {
this.handleTxLogs(
txSig,
slot,
logs,
mostRecentBlockTime,
this.currentProviderType === 'events-server',
txSigIndex
);
},
true
);
}
}
private populateInitialEventListMap() {
for (const eventType of this.options.eventTypes) {
this.eventListMap.set(
eventType,
new EventList(
eventType,
this.options.maxEventsPerType,
getSortFn(this.options.orderBy, this.options.orderDir),
this.options.orderDir
)
);
}
}
/**
* Implements fallback logic for reconnecting to LogProvider. Currently terminates at polling,
* could be improved to try the original type again after some cooldown.
*/
private updateFallbackProviderType(
reconnectAttempts: number,
maxReconnectAttempts: number
) {
if (reconnectAttempts < maxReconnectAttempts) {
return;
}
let nextProviderType = this.currentProviderType;
if (this.currentProviderType === 'events-server') {
nextProviderType = 'websocket';
} else if (this.currentProviderType === 'websocket') {
nextProviderType = 'polling';
} else if (this.currentProviderType === 'polling') {
nextProviderType = 'polling';
}
console.log(
`EventSubscriber: Failing over providerType ${this.currentProviderType} to ${nextProviderType}`
);
this.currentProviderType = nextProviderType;
}
public async subscribe(): Promise<boolean> {
try {
if (this.logProvider.isSubscribed()) {
return true;
}
this.populateInitialEventListMap();
if (
this.options.logProviderConfig.type === 'websocket' ||
this.options.logProviderConfig.type === 'events-server'
) {
const logProviderConfig = this.options
.logProviderConfig as StreamingLogProviderConfig;
if (this.logProvider.eventEmitter) {
this.logProvider.eventEmitter.on(
'reconnect',
async (reconnectAttempts) => {
if (reconnectAttempts > logProviderConfig.maxReconnectAttempts) {
console.log(
`EventSubscriber: Reconnect attempts ${reconnectAttempts}/${logProviderConfig.maxReconnectAttempts}, reconnecting...`
);
this.logProvider.eventEmitter.removeAllListeners('reconnect');
await this.unsubscribe();
this.updateFallbackProviderType(
reconnectAttempts,
logProviderConfig.maxReconnectAttempts
);
this.initializeLogProvider(true);
}
}
);
}
}
this.logProvider.subscribe(
(txSig, slot, logs, mostRecentBlockTime, txSigIndex) => {
this.handleTxLogs(
txSig,
slot,
logs,
mostRecentBlockTime,
this.currentProviderType === 'events-server',
txSigIndex
);
},
true
);
return true;
} catch (e) {
console.error('Error fetching previous txs in event subscriber');
console.error(e);
return false;
}
}
private handleTxLogs(
txSig: TransactionSignature,
slot: number,
logs: string[],
mostRecentBlockTime: number | undefined,
fromEventsServer = false,
txSigIndex: number | undefined = undefined
): void {
if (!fromEventsServer && this.txEventCache.has(txSig)) {
return;
}
const wrappedEvents = this.parseEventsFromLogs(
txSig,
slot,
logs,
txSigIndex
);
for (const wrappedEvent of wrappedEvents) {
this.eventListMap.get(wrappedEvent.eventType).insert(wrappedEvent);
}
// dont emit event till we've added all the events to the eventListMap
for (const wrappedEvent of wrappedEvents) {
this.eventEmitter.emit('newEvent', wrappedEvent);
}
if (this.awaitTxPromises.has(txSig)) {
this.awaitTxPromises.delete(txSig);
this.awaitTxResolver.get(txSig)();
this.awaitTxResolver.delete(txSig);
}
if (!this.lastSeenSlot || slot > this.lastSeenSlot) {
this.lastSeenTxSig = txSig;
this.lastSeenSlot = slot;
}
if (
this.lastSeenBlockTime === undefined ||
mostRecentBlockTime > this.lastSeenBlockTime
) {
this.lastSeenBlockTime = mostRecentBlockTime;
}
this.txEventCache.add(txSig, wrappedEvents);
}
public async fetchPreviousTx(fetchMax?: boolean): Promise<void> {
if (!this.options.untilTx && !fetchMax) {
return;
}
let txFetched = 0;
let beforeTx: TransactionSignature = undefined;
const untilTx: TransactionSignature = this.options.untilTx;
while (txFetched < this.options.maxTx) {
const response = await fetchLogs(
// @ts-ignore
this.connection,
this.address,
this.options.commitment === 'finalized' ? 'finalized' : 'confirmed',
beforeTx,
untilTx
);
if (response === undefined) {
break;
}
txFetched += response.transactionLogs.length;
beforeTx = response.earliestTx;
for (const { txSig, slot, logs } of response.transactionLogs) {
this.handleTxLogs(txSig, slot, logs, response.mostRecentBlockTime);
}
}
}
public async unsubscribe(): Promise<boolean> {
this.eventListMap.clear();
this.txEventCache.clear();
this.awaitTxPromises.clear();
this.awaitTxResolver.clear();
return await this.logProvider.unsubscribe(true);
}
private parseEventsFromLogs(
txSig: TransactionSignature,
slot: number,
logs: string[],
txSigIndex: number | undefined
): WrappedEvents {
const records = [];
// @ts-ignore
const events = parseLogs(this.program, logs);
let runningEventIndex = 0;
for (const event of events) {
// @ts-ignore
const expectRecordType = this.eventListMap.has(event.name);
if (expectRecordType) {
event.data.txSig = txSig;
event.data.slot = slot;
event.data.eventType = event.name;
event.data.txSigIndex =
txSigIndex !== undefined ? txSigIndex : runningEventIndex;
records.push(event.data);
}
runningEventIndex++;
}
return records;
}
public awaitTx(txSig: TransactionSignature): Promise<void> {
if (this.awaitTxPromises.has(txSig)) {
return this.awaitTxPromises.get(txSig);
}
if (this.txEventCache.has(txSig)) {
return Promise.resolve();
}
const promise = new Promise<void>((resolve) => {
this.awaitTxResolver.set(txSig, resolve);
});
this.awaitTxPromises.set(txSig, promise);
return promise;
}
public getEventList<Type extends keyof EventMap>(
eventType: Type
): EventList<Type> {
return this.eventListMap.get(eventType) as EventList<Type>;
}
/**
* This requires the EventList be cast to an array, which requires reallocation of memory.
* Would bias to using getEventList over getEvents
*
* @param eventType
*/
public getEventsArray<Type extends EventType>(
eventType: Type
): EventMap[Type][] {
return this.eventListMap.get(eventType).toArray() as EventMap[Type][];
}
public getEventsByTx(txSig: TransactionSignature): WrappedEvents | undefined {
return this.txEventCache.get(txSig);
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/events/sort.ts
|
import {
EventMap,
EventSubscriptionOrderBy,
EventSubscriptionOrderDirection,
EventType,
SortFn,
} from './types';
function clientSortAscFn(): 'less than' {
return 'less than';
}
function clientSortDescFn(): 'greater than' {
return 'greater than';
}
function blockchainSortFn(
currentEvent: EventMap[EventType],
newEvent: EventMap[EventType]
): 'less than' | 'greater than' {
if (currentEvent.slot == newEvent.slot) {
return currentEvent.txSigIndex < newEvent.txSigIndex
? 'less than'
: 'greater than';
}
return currentEvent.slot < newEvent.slot ? 'less than' : 'greater than';
}
export function getSortFn(
orderBy: EventSubscriptionOrderBy,
orderDir: EventSubscriptionOrderDirection
): SortFn {
if (orderBy === 'client') {
return orderDir === 'asc' ? clientSortAscFn : clientSortDescFn;
}
return blockchainSortFn;
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/events/eventsServerLogProvider.ts
|
// import WebSocket from 'ws';
import { logProviderCallback, EventType, LogProvider } from './types';
import { EventEmitter } from 'events';
// browser support
let WebSocketImpl: typeof WebSocket;
if (typeof window !== 'undefined' && window.WebSocket) {
WebSocketImpl = window.WebSocket;
} else {
WebSocketImpl = require('ws');
}
const EVENT_SERVER_HEARTBEAT_INTERVAL_MS = 5000;
const ALLOWED_MISSED_HEARTBEATS = 3;
export class EventsServerLogProvider implements LogProvider {
private ws?: WebSocket;
private callback?: logProviderCallback;
private isUnsubscribing = false;
private externalUnsubscribe = false;
private lastHeartbeat = 0;
private timeoutId?: NodeJS.Timeout;
private reconnectAttempts = 0;
eventEmitter?: EventEmitter;
public constructor(
private readonly url: string,
private readonly eventTypes: EventType[],
private readonly userAccount?: string
) {
this.eventEmitter = new EventEmitter();
}
public isSubscribed(): boolean {
return this.ws !== undefined;
}
public async subscribe(callback: logProviderCallback): Promise<boolean> {
if (this.ws !== undefined) {
return true;
}
this.ws = new WebSocketImpl(this.url);
this.callback = callback;
this.ws.addEventListener('open', () => {
for (const channel of this.eventTypes) {
const subscribeMessage = {
type: 'subscribe',
channel: channel,
};
if (this.userAccount) {
subscribeMessage['user'] = this.userAccount;
}
this.ws.send(JSON.stringify(subscribeMessage));
}
this.reconnectAttempts = 0;
});
this.ws.addEventListener('message', (data) => {
try {
if (!this.isUnsubscribing) {
clearTimeout(this.timeoutId);
this.setTimeout();
if (this.reconnectAttempts > 0) {
console.log(
'eventsServerLogProvider: Resetting reconnect attempts to 0'
);
}
this.reconnectAttempts = 0;
}
const parsedData = JSON.parse(data.data.toString());
if (parsedData.channel === 'heartbeat') {
this.lastHeartbeat = Date.now();
return;
}
if (parsedData.message !== undefined) {
return;
}
const event = JSON.parse(parsedData.data);
this.callback(
event.txSig,
event.slot,
[
'Program dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH invoke [1]',
event.rawLog,
'Program dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH success',
],
undefined,
event.txSigIndex
);
} catch (error) {
console.error('Error parsing message:', error);
}
});
this.ws.addEventListener('close', () => {
console.log('eventsServerLogProvider: WebSocket closed');
});
this.ws.addEventListener('error', (error) => {
console.error('eventsServerLogProvider: WebSocket error:', error);
});
this.setTimeout();
return true;
}
public async unsubscribe(external = false): Promise<boolean> {
this.isUnsubscribing = true;
this.externalUnsubscribe = external;
if (this.timeoutId) {
clearInterval(this.timeoutId);
this.timeoutId = undefined;
}
if (this.ws !== undefined) {
this.ws.close();
this.ws = undefined;
return true;
} else {
this.isUnsubscribing = false;
return true;
}
}
private setTimeout(): void {
this.timeoutId = setTimeout(async () => {
if (this.isUnsubscribing || this.externalUnsubscribe) {
// If we are in the process of unsubscribing, do not attempt to resubscribe
return;
}
const timeSinceLastHeartbeat = Date.now() - this.lastHeartbeat;
if (
timeSinceLastHeartbeat >
EVENT_SERVER_HEARTBEAT_INTERVAL_MS * ALLOWED_MISSED_HEARTBEATS
) {
console.log(
`eventServerLogProvider: No heartbeat in ${timeSinceLastHeartbeat}ms, resubscribing on attempt ${
this.reconnectAttempts + 1
}`
);
await this.unsubscribe();
this.reconnectAttempts++;
this.eventEmitter.emit('reconnect', this.reconnectAttempts);
this.subscribe(this.callback);
}
}, EVENT_SERVER_HEARTBEAT_INTERVAL_MS * 2);
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/events/txEventCache.ts
|
import { WrappedEvent, EventType } from './types';
class Node {
constructor(
public key: string,
public value: WrappedEvent<EventType>[],
public next?: Node,
public prev?: Node
) {}
}
// lru cache
export class TxEventCache {
size = 0;
head?: Node;
tail?: Node;
cacheMap: { [key: string]: Node } = {};
constructor(public maxTx = 1024) {}
public add(key: string, events: WrappedEvent<EventType>[]): void {
const existingNode = this.cacheMap[key];
if (existingNode) {
this.detach(existingNode);
this.size--;
} else if (this.size === this.maxTx) {
delete this.cacheMap[this.tail.key];
this.detach(this.tail);
this.size--;
}
// Write to head of LinkedList
if (!this.head) {
this.head = this.tail = new Node(key, events);
} else {
const node = new Node(key, events, this.head);
this.head.prev = node;
this.head = node;
}
// update cacheMap with LinkedList key and Node reference
this.cacheMap[key] = this.head;
this.size++;
}
public has(key: string): boolean {
return this.cacheMap.hasOwnProperty(key);
}
public get(key: string): WrappedEvent<EventType>[] | undefined {
return this.cacheMap[key]?.value;
}
detach(node: Node): void {
if (node.prev !== undefined) {
node.prev.next = node.next;
} else {
this.head = node.next;
}
if (node.next !== undefined) {
node.next.prev = node.prev;
} else {
this.tail = node.prev;
}
}
public clear(): void {
this.head = undefined;
this.tail = undefined;
this.size = 0;
this.cacheMap = {};
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/bankrun/bankrunConnection.ts
|
import {
TransactionConfirmationStatus,
AccountInfo,
Keypair,
PublicKey,
Transaction,
RpcResponseAndContext,
Commitment,
TransactionSignature,
SignatureStatusConfig,
SignatureStatus,
GetVersionedTransactionConfig,
GetTransactionConfig,
VersionedTransaction,
SimulateTransactionConfig,
SimulatedTransactionResponse,
TransactionReturnData,
TransactionError,
SignatureResultCallback,
ClientSubscriptionId,
Connection as SolanaConnection,
SystemProgram,
Blockhash,
LogsFilter,
LogsCallback,
AccountChangeCallback,
LAMPORTS_PER_SOL,
AddressLookupTableAccount,
} from '@solana/web3.js';
import {
ProgramTestContext,
BanksClient,
BanksTransactionResultWithMeta,
Clock,
} from 'solana-bankrun';
import { BankrunProvider } from 'anchor-bankrun';
import bs58 from 'bs58';
import { BN, Wallet } from '@coral-xyz/anchor';
import { Account, unpackAccount } from '@solana/spl-token';
import { isVersionedTransaction } from '../tx/utils';
export type Connection = SolanaConnection | BankrunConnection;
type BankrunTransactionMetaNormalized = {
logMessages: string[];
err: TransactionError;
};
type BankrunTransactionRespose = {
slot: number;
meta: BankrunTransactionMetaNormalized;
};
export class BankrunContextWrapper {
public readonly connection: BankrunConnection;
public readonly context: ProgramTestContext;
public readonly provider: BankrunProvider;
public readonly commitment: Commitment = 'confirmed';
constructor(context: ProgramTestContext, verifySignatures = true) {
this.context = context;
this.provider = new BankrunProvider(context);
this.connection = new BankrunConnection(
this.context.banksClient,
this.context,
verifySignatures
);
}
async sendTransaction(
tx: Transaction | VersionedTransaction,
additionalSigners?: Keypair[]
): Promise<TransactionSignature> {
const isVersioned = isVersionedTransaction(tx);
if (!additionalSigners) {
additionalSigners = [];
}
if (isVersioned) {
tx = tx as VersionedTransaction;
tx.message.recentBlockhash = await this.getLatestBlockhash();
if (!additionalSigners) {
additionalSigners = [];
}
tx.sign([this.context.payer, ...additionalSigners]);
} else {
tx = tx as Transaction;
tx.recentBlockhash = await this.getLatestBlockhash();
tx.feePayer = this.context.payer.publicKey;
tx.sign(this.context.payer, ...additionalSigners);
}
return await this.connection.sendTransaction(tx);
}
async getMinimumBalanceForRentExemption(_: number): Promise<number> {
return 10 * LAMPORTS_PER_SOL;
}
async fundKeypair(
keypair: Keypair | Wallet,
lamports: number | bigint
): Promise<TransactionSignature> {
const ixs = [
SystemProgram.transfer({
fromPubkey: this.context.payer.publicKey,
toPubkey: keypair.publicKey,
lamports,
}),
];
const tx = new Transaction().add(...ixs);
return await this.sendTransaction(tx);
}
async getLatestBlockhash(): Promise<Blockhash> {
const blockhash = await this.connection.getLatestBlockhash('finalized');
return blockhash.blockhash;
}
printTxLogs(signature: string): void {
this.connection.printTxLogs(signature);
}
async moveTimeForward(increment: number): Promise<void> {
const currentClock = await this.context.banksClient.getClock();
const newUnixTimestamp = currentClock.unixTimestamp + BigInt(increment);
const newClock = new Clock(
currentClock.slot,
currentClock.epochStartTimestamp,
currentClock.epoch,
currentClock.leaderScheduleEpoch,
newUnixTimestamp
);
await this.context.setClock(newClock);
}
async setTimestamp(unix_timestamp: number): Promise<void> {
const currentClock = await this.context.banksClient.getClock();
const newUnixTimestamp = BigInt(unix_timestamp);
const newClock = new Clock(
currentClock.slot,
currentClock.epochStartTimestamp,
currentClock.epoch,
currentClock.leaderScheduleEpoch,
newUnixTimestamp
);
await this.context.setClock(newClock);
}
}
export class BankrunConnection {
private readonly _banksClient: BanksClient;
private readonly context: ProgramTestContext;
private transactionToMeta: Map<
TransactionSignature,
BanksTransactionResultWithMeta
> = new Map();
private clock: Clock;
private nextClientSubscriptionId = 0;
private onLogCallbacks = new Map<number, LogsCallback>();
private onAccountChangeCallbacks = new Map<
number,
[PublicKey, AccountChangeCallback]
>();
private verifySignatures: boolean;
constructor(
banksClient: BanksClient,
context: ProgramTestContext,
verifySignatures = true
) {
this._banksClient = banksClient;
this.context = context;
this.verifySignatures = verifySignatures;
}
getSlot(): Promise<bigint> {
return this._banksClient.getSlot();
}
toConnection(): SolanaConnection {
return this as unknown as SolanaConnection;
}
async getTokenAccount(publicKey: PublicKey): Promise<Account> {
const info = await this.getAccountInfo(publicKey);
return unpackAccount(publicKey, info, info.owner);
}
async getMultipleAccountsInfo(
publicKeys: PublicKey[],
_commitmentOrConfig?: Commitment
): Promise<AccountInfo<Buffer>[]> {
const accountInfos = [];
for (const publicKey of publicKeys) {
const accountInfo = await this.getAccountInfo(publicKey);
accountInfos.push(accountInfo);
}
return accountInfos;
}
async getAccountInfo(
publicKey: PublicKey
): Promise<null | AccountInfo<Buffer>> {
const parsedAccountInfo = await this.getParsedAccountInfo(publicKey);
return parsedAccountInfo ? parsedAccountInfo.value : null;
}
async getAccountInfoAndContext(
publicKey: PublicKey,
_commitment?: Commitment
): Promise<RpcResponseAndContext<null | AccountInfo<Buffer>>> {
return await this.getParsedAccountInfo(publicKey);
}
async sendRawTransaction(
rawTransaction: Buffer | Uint8Array | Array<number>,
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
_options?: any
): Promise<TransactionSignature> {
const tx = Transaction.from(rawTransaction);
const signature = await this.sendTransaction(tx);
return signature;
}
async sendTransaction(
tx: Transaction | VersionedTransaction
): Promise<TransactionSignature> {
const isVersioned = isVersionedTransaction(tx);
const serialized = isVersioned
? tx.serialize()
: tx.serialize({
verifySignatures: this.verifySignatures,
});
// @ts-ignore
const internal = this._banksClient.inner;
const inner = isVersioned
? await internal.tryProcessVersionedTransaction(serialized)
: await internal.tryProcessLegacyTransaction(serialized);
const banksTransactionMeta = new BanksTransactionResultWithMeta(inner);
if (banksTransactionMeta.result) {
throw new Error(banksTransactionMeta.result);
}
const signature = isVersioned
? bs58.encode((tx as VersionedTransaction).signatures[0])
: bs58.encode((tx as Transaction).signatures[0].signature);
this.transactionToMeta.set(signature, banksTransactionMeta);
let finalizedCount = 0;
while (finalizedCount < 10) {
const signatureStatus = (await this.getSignatureStatus(signature)).value
.confirmationStatus;
if (signatureStatus.toString() == '"finalized"') {
finalizedCount += 1;
}
}
// update the clock slot/timestamp
// sometimes race condition causes failures so we retry
try {
await this.updateSlotAndClock();
} catch (e) {
await this.updateSlotAndClock();
}
if (this.onLogCallbacks.size > 0) {
const transaction = await this.getTransaction(signature);
const context = { slot: transaction.slot };
const logs = {
logs: transaction.meta.logMessages,
err: transaction.meta.err,
signature,
};
for (const logCallback of this.onLogCallbacks.values()) {
logCallback(logs, context);
}
}
for (const [
publicKey,
callback,
] of this.onAccountChangeCallbacks.values()) {
const accountInfo = await this.getParsedAccountInfo(publicKey);
callback(accountInfo.value, accountInfo.context);
}
return signature;
}
private async updateSlotAndClock() {
const currentSlot = await this.getSlot();
const nextSlot = currentSlot + BigInt(1);
this.context.warpToSlot(nextSlot);
const currentClock = await this._banksClient.getClock();
const newClock = new Clock(
nextSlot,
currentClock.epochStartTimestamp,
currentClock.epoch,
currentClock.leaderScheduleEpoch,
currentClock.unixTimestamp + BigInt(1)
);
this.context.setClock(newClock);
this.clock = newClock;
}
getTime(): number {
return Number(this.clock.unixTimestamp);
}
async getParsedAccountInfo(
publicKey: PublicKey
): Promise<RpcResponseAndContext<AccountInfo<Buffer>>> {
const accountInfoBytes = await this._banksClient.getAccount(publicKey);
if (accountInfoBytes === null) {
return {
context: { slot: Number(await this._banksClient.getSlot()) },
value: null,
};
}
accountInfoBytes.data = Buffer.from(accountInfoBytes.data);
const accountInfoBuffer = accountInfoBytes as AccountInfo<Buffer>;
return {
context: { slot: Number(await this._banksClient.getSlot()) },
value: accountInfoBuffer,
};
}
async getLatestBlockhash(commitment?: Commitment): Promise<
Readonly<{
blockhash: string;
lastValidBlockHeight: number;
}>
> {
const blockhashAndBlockheight = await this._banksClient.getLatestBlockhash(
commitment
);
return {
blockhash: blockhashAndBlockheight[0],
lastValidBlockHeight: Number(blockhashAndBlockheight[1]),
};
}
async getAddressLookupTable(
accountKey: PublicKey
): Promise<RpcResponseAndContext<null | AddressLookupTableAccount>> {
const { context, value: accountInfo } = await this.getParsedAccountInfo(
accountKey
);
let value = null;
if (accountInfo !== null) {
value = new AddressLookupTableAccount({
key: accountKey,
state: AddressLookupTableAccount.deserialize(accountInfo.data),
});
}
return {
context,
value,
};
}
async getSignatureStatus(
signature: string,
_config?: SignatureStatusConfig
): Promise<RpcResponseAndContext<null | SignatureStatus>> {
const transactionStatus = await this._banksClient.getTransactionStatus(
signature
);
if (transactionStatus === null) {
return {
context: { slot: Number(await this._banksClient.getSlot()) },
value: null,
};
}
return {
context: { slot: Number(await this._banksClient.getSlot()) },
value: {
slot: Number(transactionStatus.slot),
confirmations: Number(transactionStatus.confirmations),
err: transactionStatus.err,
confirmationStatus:
transactionStatus.confirmationStatus as TransactionConfirmationStatus,
},
};
}
/**
* There's really no direct equivalent to getTransaction exposed by SolanaProgramTest, so we do the best that we can here - it's a little hacky.
*/
async getTransaction(
signature: string,
_rawConfig?: GetTransactionConfig | GetVersionedTransactionConfig
): Promise<BankrunTransactionRespose | null> {
const txMeta = this.transactionToMeta.get(
signature as TransactionSignature
);
if (txMeta === undefined) {
return null;
}
const transactionStatus = await this._banksClient.getTransactionStatus(
signature
);
const meta: BankrunTransactionMetaNormalized = {
logMessages: txMeta.meta.logMessages,
err: txMeta.result,
};
return {
slot: Number(transactionStatus.slot),
meta,
};
}
findComputeUnitConsumption(signature: string): bigint {
const txMeta = this.transactionToMeta.get(
signature as TransactionSignature
);
if (txMeta === undefined) {
throw new Error('Transaction not found');
}
return txMeta.meta.computeUnitsConsumed;
}
printTxLogs(signature: string): void {
const txMeta = this.transactionToMeta.get(
signature as TransactionSignature
);
if (txMeta === undefined) {
throw new Error('Transaction not found');
}
console.log(txMeta.meta.logMessages);
}
async simulateTransaction(
transaction: Transaction | VersionedTransaction,
_config?: SimulateTransactionConfig
): Promise<RpcResponseAndContext<SimulatedTransactionResponse>> {
const simulationResult = await this._banksClient.simulateTransaction(
transaction
);
const returnDataProgramId =
simulationResult.meta?.returnData?.programId.toBase58();
const returnDataNormalized = Buffer.from(
simulationResult.meta?.returnData?.data
).toString('base64');
const returnData: TransactionReturnData = {
programId: returnDataProgramId,
data: [returnDataNormalized, 'base64'],
};
return {
context: { slot: Number(await this._banksClient.getSlot()) },
value: {
err: simulationResult.result,
logs: simulationResult.meta.logMessages,
accounts: undefined,
unitsConsumed: Number(simulationResult.meta.computeUnitsConsumed),
returnData,
},
};
}
onSignature(
signature: string,
callback: SignatureResultCallback,
commitment?: Commitment
): ClientSubscriptionId {
const txMeta = this.transactionToMeta.get(
signature as TransactionSignature
);
this._banksClient.getSlot(commitment).then((slot) => {
if (txMeta) {
callback({ err: txMeta.result }, { slot: Number(slot) });
}
});
return 0;
}
async removeSignatureListener(_clientSubscriptionId: number): Promise<void> {
// Nothing actually has to happen here! Pretty cool, huh?
// This function signature only exists to match the web3js interface
}
onLogs(
filter: LogsFilter,
callback: LogsCallback,
_commitment?: Commitment
): ClientSubscriptionId {
const subscriptId = this.nextClientSubscriptionId;
this.onLogCallbacks.set(subscriptId, callback);
this.nextClientSubscriptionId += 1;
return subscriptId;
}
async removeOnLogsListener(
clientSubscriptionId: ClientSubscriptionId
): Promise<void> {
this.onLogCallbacks.delete(clientSubscriptionId);
}
onAccountChange(
publicKey: PublicKey,
callback: AccountChangeCallback,
// @ts-ignore
_commitment?: Commitment
): ClientSubscriptionId {
const subscriptId = this.nextClientSubscriptionId;
this.onAccountChangeCallbacks.set(subscriptId, [publicKey, callback]);
this.nextClientSubscriptionId += 1;
return subscriptId;
}
async removeAccountChangeListener(
clientSubscriptionId: ClientSubscriptionId
): Promise<void> {
this.onAccountChangeCallbacks.delete(clientSubscriptionId);
}
async getMinimumBalanceForRentExemption(_: number): Promise<number> {
return 10 * LAMPORTS_PER_SOL;
}
}
export function asBN(value: number | bigint): BN {
return new BN(Number(value));
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/userMap/userMapConfig.ts
|
import { Commitment, Connection, MemcmpFilter } from '@solana/web3.js';
import { DriftClient } from '../driftClient';
import { GrpcConfigs } from '../accounts/types';
// passed into UserMap.getUniqueAuthorities to filter users
export type UserAccountFilterCriteria = {
// only return users that have open orders
hasOpenOrders: boolean;
};
export type SyncConfig =
| {
type: 'default';
}
| {
type: 'paginated';
chunkSize?: number;
concurrencyLimit?: number;
};
export type UserMapConfig = {
driftClient: DriftClient;
// connection object to use specifically for the UserMap. If undefined, will use the driftClient's connection
connection?: Connection;
subscriptionConfig:
| {
type: 'polling';
frequency: number;
commitment?: Commitment;
}
| {
type: 'grpc';
grpcConfigs: GrpcConfigs;
resubTimeoutMs?: number;
logResubMessages?: boolean;
}
| {
type: 'websocket';
resubTimeoutMs?: number;
logResubMessages?: boolean;
commitment?: Commitment;
};
// True to skip the initial load of userAccounts via getProgramAccounts
skipInitialLoad?: boolean;
// True to include idle users when loading. Defaults to false to decrease # of accounts subscribed to.
includeIdle?: boolean;
// Whether to skip loading available perp/spot positions and open orders
fastDecode?: boolean;
// If true, will not do a full sync whenever StateAccount.numberOfSubAccounts changes.
// default behavior is to do a full sync on changes.
disableSyncOnTotalAccountsChange?: boolean;
syncConfig?: SyncConfig;
// Whether to throw an error if the userMap fails to sync. Defaults to true.
throwOnFailedSync?: boolean;
additionalFilters?: MemcmpFilter[];
};
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/userMap/referrerMap.ts
|
import {
MemcmpFilter,
PublicKey,
RpcResponseAndContext,
} from '@solana/web3.js';
import { DriftClient } from '../driftClient';
import { ReferrerInfo } from '../types';
import {
getUserAccountPublicKeySync,
getUserStatsAccountPublicKey,
} from '../addresses/pda';
import {
getUserStatsFilter,
getUserStatsIsReferredFilter,
getUserStatsIsReferredOrReferrerFilter,
} from '../memcmp';
import { bs58 } from '@coral-xyz/anchor/dist/cjs/utils/bytes';
const DEFAULT_PUBLIC_KEY = PublicKey.default.toBase58();
export class ReferrerMap {
/**
* map from authority pubkey to referrer pubkey.
*/
private authorityReferrerMap = new Map<string, string>();
/**
* map from referrer pubkey to ReferrerInfo.
* Will be undefined if the referrer is not in the map yet.
*/
private referrerReferrerInfoMap = new Map<string, ReferrerInfo>();
private driftClient: DriftClient;
private parallelSync: boolean;
private fetchPromise?: Promise<void>;
private fetchPromiseResolver: () => void;
/**
* Creates a new UserStatsMap instance.
*
* @param {DriftClient} driftClient - The DriftClient instance.
*/
constructor(driftClient: DriftClient, parallelSync?: boolean) {
this.driftClient = driftClient;
this.parallelSync = parallelSync !== undefined ? parallelSync : true;
}
/**
* Subscribe to all UserStats accounts.
*/
public async subscribe() {
if (this.size() > 0) {
return;
}
await this.driftClient.subscribe();
await this.sync();
}
public has(authorityPublicKey: string): boolean {
return this.authorityReferrerMap.has(authorityPublicKey);
}
public get(authorityPublicKey: string): ReferrerInfo | undefined {
return this.getReferrer(authorityPublicKey);
}
public async addReferrer(authority: string, referrer?: string) {
if (referrer) {
this.authorityReferrerMap.set(authority, referrer);
} else if (referrer === undefined) {
const userStatsAccountPublicKey = getUserStatsAccountPublicKey(
this.driftClient.program.programId,
new PublicKey(authority)
);
const buffer = (
await this.driftClient.connection.getAccountInfo(
userStatsAccountPublicKey,
'processed'
)
).data;
const referrer = bs58.encode(buffer.subarray(40, 72));
this.addReferrer(authority, referrer);
}
}
/**
* Enforce that a UserStats will exist for the given authorityPublicKey,
* reading one from the blockchain if necessary.
* @param authorityPublicKey
* @returns
*/
public async mustGet(
authorityPublicKey: string
): Promise<ReferrerInfo | undefined> {
if (!this.has(authorityPublicKey)) {
await this.addReferrer(authorityPublicKey);
}
return this.getReferrer(authorityPublicKey);
}
public getReferrer(authorityPublicKey: string): ReferrerInfo | undefined {
const referrer = this.authorityReferrerMap.get(authorityPublicKey);
if (!referrer) {
// return undefined if the referrer is not in the map
return undefined;
}
if (referrer === DEFAULT_PUBLIC_KEY) {
return undefined;
}
if (this.referrerReferrerInfoMap.has(referrer)) {
return this.referrerReferrerInfoMap.get(referrer);
}
const referrerKey = new PublicKey(referrer);
const referrerInfo = {
referrer: getUserAccountPublicKeySync(
this.driftClient.program.programId,
referrerKey,
0
),
referrerStats: getUserStatsAccountPublicKey(
this.driftClient.program.programId,
referrerKey
),
};
this.referrerReferrerInfoMap.set(referrer, referrerInfo);
return referrerInfo;
}
public size(): number {
return this.authorityReferrerMap.size;
}
public numberOfReferred(): number {
return Array.from(this.authorityReferrerMap.values()).filter(
(referrer) => referrer !== DEFAULT_PUBLIC_KEY
).length;
}
public async sync(): Promise<void> {
if (this.fetchPromise) {
return this.fetchPromise;
}
this.fetchPromise = new Promise((resolver) => {
this.fetchPromiseResolver = resolver;
});
try {
if (this.parallelSync) {
await Promise.all([
this.syncAll(),
this.syncReferrer(getUserStatsIsReferredFilter()),
this.syncReferrer(getUserStatsIsReferredOrReferrerFilter()),
]);
} else {
await this.syncAll();
await this.syncReferrer(getUserStatsIsReferredFilter());
await this.syncReferrer(getUserStatsIsReferredOrReferrerFilter());
}
} finally {
this.fetchPromiseResolver();
this.fetchPromise = undefined;
}
}
public async syncAll(): Promise<void> {
const rpcRequestArgs = [
this.driftClient.program.programId.toBase58(),
{
commitment: this.driftClient.opts.commitment,
filters: [getUserStatsFilter()],
encoding: 'base64',
dataSlice: {
offset: 0,
length: 0,
},
withContext: true,
},
];
const rpcJSONResponse: any =
// @ts-ignore
await this.driftClient.connection._rpcRequest(
'getProgramAccounts',
rpcRequestArgs
);
const rpcResponseAndContext: RpcResponseAndContext<
Array<{
pubkey: string;
account: {
data: [string, string];
};
}>
> = rpcJSONResponse.result;
for (const account of rpcResponseAndContext.value) {
// only add if it isn't already in the map
// so that if syncReferrer already set it, we dont overwrite
if (!this.has(account.pubkey)) {
this.addReferrer(account.pubkey, DEFAULT_PUBLIC_KEY);
}
}
}
async syncReferrer(referrerFilter: MemcmpFilter): Promise<void> {
const rpcRequestArgs = [
this.driftClient.program.programId.toBase58(),
{
commitment: this.driftClient.opts.commitment,
filters: [getUserStatsFilter(), referrerFilter],
encoding: 'base64',
dataSlice: {
offset: 0,
length: 72,
},
withContext: true,
},
];
const rpcJSONResponse: any =
// @ts-ignore
await this.driftClient.connection._rpcRequest(
'getProgramAccounts',
rpcRequestArgs
);
const rpcResponseAndContext: RpcResponseAndContext<
Array<{
pubkey: string;
account: {
data: [string, string];
};
}>
> = rpcJSONResponse.result;
const batchSize = 1000;
for (let i = 0; i < rpcResponseAndContext.value.length; i += batchSize) {
const batch = rpcResponseAndContext.value.slice(i, i + batchSize);
await Promise.all(
batch.map(async (programAccount) => {
// @ts-ignore
const buffer = Buffer.from(
programAccount.account.data[0],
programAccount.account.data[1]
);
const authority = bs58.encode(buffer.subarray(8, 40));
const referrer = bs58.encode(buffer.subarray(40, 72));
this.addReferrer(authority, referrer);
})
);
await new Promise((resolve) => setTimeout(resolve, 0));
}
}
public async unsubscribe() {
this.authorityReferrerMap.clear();
this.referrerReferrerInfoMap.clear();
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/userMap/PollingSubscription.ts
|
import { UserMap } from './userMap';
export class PollingSubscription {
private userMap: UserMap;
private frequency: number;
private skipInitialLoad: boolean;
intervalId?: NodeJS.Timeout;
constructor({
userMap,
frequency,
skipInitialLoad = false,
}: {
userMap: UserMap;
frequency: number;
skipInitialLoad?: boolean;
includeIdle?: boolean;
}) {
this.userMap = userMap;
this.frequency = frequency;
this.skipInitialLoad = skipInitialLoad;
}
public async subscribe(): Promise<void> {
if (this.intervalId || this.frequency <= 0) {
return;
}
const executeSync = async () => {
await this.userMap.sync();
this.intervalId = setTimeout(executeSync, this.frequency);
};
if (!this.skipInitialLoad) {
await this.userMap.sync();
}
executeSync();
}
public async unsubscribe(): Promise<void> {
if (this.intervalId) {
clearInterval(this.intervalId);
this.intervalId = undefined;
}
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/userMap/WebsocketSubscription.ts
|
import { UserMap } from './userMap';
import { getNonIdleUserFilter, getUserFilter } from '../memcmp';
import { WebSocketProgramAccountSubscriber } from '../accounts/webSocketProgramAccountSubscriber';
import { UserAccount } from '../types';
import { Commitment, Context, MemcmpFilter, PublicKey } from '@solana/web3.js';
import { ResubOpts } from '../accounts/types';
export class WebsocketSubscription {
private userMap: UserMap;
private commitment: Commitment;
private skipInitialLoad: boolean;
private resubOpts?: ResubOpts;
private includeIdle?: boolean;
private additionalFilters?: MemcmpFilter[];
private decodeFn: (name: string, data: Buffer) => UserAccount;
private subscriber: WebSocketProgramAccountSubscriber<UserAccount>;
constructor({
userMap,
commitment,
skipInitialLoad = false,
resubOpts,
includeIdle = false,
decodeFn,
additionalFilters = undefined,
}: {
userMap: UserMap;
commitment: Commitment;
skipInitialLoad?: boolean;
resubOpts?: ResubOpts;
includeIdle?: boolean;
decodeFn: (name: string, data: Buffer) => UserAccount;
additionalFilters?: MemcmpFilter[];
}) {
this.userMap = userMap;
this.commitment = commitment;
this.skipInitialLoad = skipInitialLoad;
this.resubOpts = resubOpts;
this.includeIdle = includeIdle || false;
this.decodeFn = decodeFn;
this.additionalFilters = additionalFilters;
}
public async subscribe(): Promise<void> {
if (!this.subscriber) {
const filters = [getUserFilter()];
if (!this.includeIdle) {
filters.push(getNonIdleUserFilter());
}
if (this.additionalFilters) {
filters.push(...this.additionalFilters);
}
this.subscriber = new WebSocketProgramAccountSubscriber<UserAccount>(
'UserMap',
'User',
this.userMap.driftClient.program,
this.decodeFn,
{
filters,
commitment: this.commitment,
},
this.resubOpts
);
}
await this.subscriber.subscribe(
(accountId: PublicKey, account: UserAccount, context: Context) => {
const userKey = accountId.toBase58();
this.userMap.updateUserAccount(userKey, account, context.slot);
}
);
if (!this.skipInitialLoad) {
await this.userMap.sync();
}
}
public async unsubscribe(): Promise<void> {
if (!this.subscriber) return;
await this.subscriber.unsubscribe();
this.subscriber = undefined;
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/userMap/userStatsMap.ts
|
import {
DriftClient,
getUserStatsAccountPublicKey,
OrderRecord,
UserStatsAccount,
UserStats,
WrappedEvent,
DepositRecord,
FundingPaymentRecord,
LiquidationRecord,
OrderActionRecord,
SettlePnlRecord,
NewUserRecord,
LPRecord,
InsuranceFundStakeRecord,
BulkAccountLoader,
PollingUserStatsAccountSubscriber,
} from '..';
import { PublicKey } from '@solana/web3.js';
import { UserMap } from './userMap';
export class UserStatsMap {
/**
* map from authority pubkey to UserStats
*/
private userStatsMap = new Map<string, UserStats>();
private driftClient: DriftClient;
private bulkAccountLoader: BulkAccountLoader;
/**
* Creates a new UserStatsMap instance.
*
* @param {DriftClient} driftClient - The DriftClient instance.
* @param {BulkAccountLoader} [bulkAccountLoader] - If not provided, a new BulkAccountLoader with polling disabled will be created.
*/
constructor(driftClient: DriftClient, bulkAccountLoader?: BulkAccountLoader) {
this.driftClient = driftClient;
if (!bulkAccountLoader) {
bulkAccountLoader = new BulkAccountLoader(
driftClient.connection,
driftClient.opts.commitment,
0
);
}
this.bulkAccountLoader = bulkAccountLoader;
}
public async subscribe(authorities: PublicKey[]) {
if (this.size() > 0) {
return;
}
await this.driftClient.subscribe();
await this.sync(authorities);
}
/**
*
* @param authority that owns the UserStatsAccount
* @param userStatsAccount optional UserStatsAccount to subscribe to, if undefined will be fetched later
* @param skipFetch if true, will not immediately fetch the UserStatsAccount
*/
public async addUserStat(
authority: PublicKey,
userStatsAccount?: UserStatsAccount,
skipFetch?: boolean
) {
const userStat = new UserStats({
driftClient: this.driftClient,
userStatsAccountPublicKey: getUserStatsAccountPublicKey(
this.driftClient.program.programId,
authority
),
accountSubscription: {
type: 'polling',
accountLoader: this.bulkAccountLoader,
},
});
if (skipFetch) {
await (
userStat.accountSubscriber as PollingUserStatsAccountSubscriber
).addToAccountLoader();
} else {
await userStat.subscribe(userStatsAccount);
}
this.userStatsMap.set(authority.toString(), userStat);
}
public async updateWithOrderRecord(record: OrderRecord, userMap: UserMap) {
const user = await userMap.mustGet(record.user.toString());
if (!this.has(user.getUserAccount().authority.toString())) {
await this.addUserStat(user.getUserAccount().authority, undefined, false);
}
}
public async updateWithEventRecord(
record: WrappedEvent<any>,
userMap?: UserMap
) {
if (record.eventType === 'DepositRecord') {
const depositRecord = record as DepositRecord;
await this.mustGet(depositRecord.userAuthority.toString());
} else if (record.eventType === 'FundingPaymentRecord') {
const fundingPaymentRecord = record as FundingPaymentRecord;
await this.mustGet(fundingPaymentRecord.userAuthority.toString());
} else if (record.eventType === 'LiquidationRecord') {
if (!userMap) {
return;
}
const liqRecord = record as LiquidationRecord;
const user = await userMap.mustGet(liqRecord.user.toString());
await this.mustGet(user.getUserAccount().authority.toString());
const liquidatorUser = await userMap.mustGet(
liqRecord.liquidator.toString()
);
await this.mustGet(liquidatorUser.getUserAccount().authority.toString());
} else if (record.eventType === 'OrderRecord') {
if (!userMap) {
return;
}
const orderRecord = record as OrderRecord;
await userMap.updateWithOrderRecord(orderRecord);
} else if (record.eventType === 'OrderActionRecord') {
if (!userMap) {
return;
}
const actionRecord = record as OrderActionRecord;
if (actionRecord.taker) {
const taker = await userMap.mustGet(actionRecord.taker.toString());
await this.mustGet(taker.getUserAccount().authority.toString());
}
if (actionRecord.maker) {
const maker = await userMap.mustGet(actionRecord.maker.toString());
await this.mustGet(maker.getUserAccount().authority.toString());
}
} else if (record.eventType === 'SettlePnlRecord') {
if (!userMap) {
return;
}
const settlePnlRecord = record as SettlePnlRecord;
const user = await userMap.mustGet(settlePnlRecord.user.toString());
await this.mustGet(user.getUserAccount().authority.toString());
} else if (record.eventType === 'NewUserRecord') {
const newUserRecord = record as NewUserRecord;
await this.mustGet(newUserRecord.userAuthority.toString());
} else if (record.eventType === 'LPRecord') {
if (!userMap) {
return;
}
const lpRecord = record as LPRecord;
const user = await userMap.mustGet(lpRecord.user.toString());
await this.mustGet(user.getUserAccount().authority.toString());
} else if (record.eventType === 'InsuranceFundStakeRecord') {
const ifStakeRecord = record as InsuranceFundStakeRecord;
await this.mustGet(ifStakeRecord.userAuthority.toString());
}
}
public has(authorityPublicKey: string): boolean {
return this.userStatsMap.has(authorityPublicKey);
}
public get(authorityPublicKey: string): UserStats {
return this.userStatsMap.get(authorityPublicKey);
}
/**
* Enforce that a UserStats will exist for the given authorityPublicKey,
* reading one from the blockchain if necessary.
* @param authorityPublicKey
* @returns
*/
public async mustGet(authorityPublicKey: string): Promise<UserStats> {
if (!this.has(authorityPublicKey)) {
await this.addUserStat(
new PublicKey(authorityPublicKey),
undefined,
false
);
}
return this.get(authorityPublicKey);
}
public values(): IterableIterator<UserStats> {
return this.userStatsMap.values();
}
public size(): number {
return this.userStatsMap.size;
}
/**
* Sync the UserStatsMap
* @param authorities list of authorities to derive UserStatsAccount public keys from.
* You may want to get this list from UserMap in order to filter out idle users
*/
public async sync(authorities: PublicKey[]) {
await Promise.all(
authorities.map((authority) =>
this.addUserStat(authority, undefined, true)
)
);
await this.bulkAccountLoader.load();
}
public async unsubscribe() {
for (const [key, userStats] of this.userStatsMap.entries()) {
await userStats.unsubscribe();
this.userStatsMap.delete(key);
}
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/userMap/userMap.ts
|
import {
User,
DriftClient,
UserAccount,
OrderRecord,
WrappedEvent,
DepositRecord,
FundingPaymentRecord,
LiquidationRecord,
OrderActionRecord,
SettlePnlRecord,
NewUserRecord,
LPRecord,
StateAccount,
DLOB,
BN,
UserSubscriptionConfig,
DataAndSlot,
OneShotUserAccountSubscriber,
} from '..';
import {
Commitment,
Connection,
MemcmpFilter,
PublicKey,
RpcResponseAndContext,
} from '@solana/web3.js';
import { Buffer } from 'buffer';
import { ZSTDDecoder } from 'zstddec';
import { getNonIdleUserFilter, getUserFilter } from '../memcmp';
import {
SyncConfig,
UserAccountFilterCriteria as UserFilterCriteria,
UserMapConfig,
} from './userMapConfig';
import { WebsocketSubscription } from './WebsocketSubscription';
import { PollingSubscription } from './PollingSubscription';
import { decodeUser } from '../decode/user';
import { grpcSubscription } from './grpcSubscription';
const MAX_USER_ACCOUNT_SIZE_BYTES = 4376;
export interface UserMapInterface {
subscribe(): Promise<void>;
unsubscribe(): Promise<void>;
addPubkey(
userAccountPublicKey: PublicKey,
userAccount?: UserAccount,
slot?: number,
accountSubscription?: UserSubscriptionConfig
): Promise<void>;
has(key: string): boolean;
get(key: string): User | undefined;
getWithSlot(key: string): DataAndSlot<User> | undefined;
mustGet(
key: string,
accountSubscription?: UserSubscriptionConfig
): Promise<User>;
mustGetWithSlot(
key: string,
accountSubscription?: UserSubscriptionConfig
): Promise<DataAndSlot<User>>;
getUserAuthority(key: string): PublicKey | undefined;
updateWithOrderRecord(record: OrderRecord): Promise<void>;
values(): IterableIterator<User>;
valuesWithSlot(): IterableIterator<DataAndSlot<User>>;
entries(): IterableIterator<[string, User]>;
entriesWithSlot(): IterableIterator<[string, DataAndSlot<User>]>;
}
export class UserMap implements UserMapInterface {
private userMap = new Map<string, DataAndSlot<User>>();
driftClient: DriftClient;
private connection: Connection;
private commitment: Commitment;
private includeIdle: boolean;
private additionalFilters?: MemcmpFilter[];
private disableSyncOnTotalAccountsChange: boolean;
private lastNumberOfSubAccounts: BN;
private subscription:
| PollingSubscription
| WebsocketSubscription
| grpcSubscription;
private stateAccountUpdateCallback = async (state: StateAccount) => {
if (!state.numberOfSubAccounts.eq(this.lastNumberOfSubAccounts)) {
await this.sync();
this.lastNumberOfSubAccounts = state.numberOfSubAccounts;
}
};
private decode;
private mostRecentSlot = 0;
private syncConfig: SyncConfig;
private syncPromise?: Promise<void>;
private syncPromiseResolver: () => void;
private throwOnFailedSync: boolean;
/**
* Constructs a new UserMap instance.
*/
constructor(config: UserMapConfig) {
this.driftClient = config.driftClient;
if (config.connection) {
this.connection = config.connection;
} else {
this.connection = this.driftClient.connection;
}
this.commitment =
config.subscriptionConfig.type === 'websocket' ||
config.subscriptionConfig.type === 'polling'
? config.subscriptionConfig.commitment ??
this.driftClient.opts.commitment
: this.driftClient.opts.commitment;
this.includeIdle = config.includeIdle ?? false;
this.additionalFilters = config.additionalFilters;
this.disableSyncOnTotalAccountsChange =
config.disableSyncOnTotalAccountsChange ?? false;
let decodeFn;
if (config.fastDecode ?? true) {
decodeFn = (name, buffer) => decodeUser(buffer);
} else {
decodeFn =
this.driftClient.program.account.user.coder.accounts.decodeUnchecked.bind(
this.driftClient.program.account.user.coder.accounts
);
}
this.decode = decodeFn;
if (config.subscriptionConfig.type === 'polling') {
this.subscription = new PollingSubscription({
userMap: this,
frequency: config.subscriptionConfig.frequency,
skipInitialLoad: config.skipInitialLoad,
});
} else if (config.subscriptionConfig.type === 'grpc') {
this.subscription = new grpcSubscription({
userMap: this,
grpcConfigs: config.subscriptionConfig.grpcConfigs,
resubOpts: {
resubTimeoutMs: config.subscriptionConfig.resubTimeoutMs,
logResubMessages: config.subscriptionConfig.logResubMessages,
},
skipInitialLoad: config.skipInitialLoad,
decodeFn,
});
} else {
this.subscription = new WebsocketSubscription({
userMap: this,
commitment: this.commitment,
resubOpts: {
resubTimeoutMs: config.subscriptionConfig.resubTimeoutMs,
logResubMessages: config.subscriptionConfig.logResubMessages,
},
skipInitialLoad: config.skipInitialLoad,
decodeFn,
});
}
this.syncConfig = config.syncConfig ?? {
type: 'default',
};
// Whether to throw an error if the userMap fails to sync. Defaults to false.
this.throwOnFailedSync = config.throwOnFailedSync ?? false;
}
public async subscribe() {
if (this.size() > 0) {
return;
}
await this.driftClient.subscribe();
this.lastNumberOfSubAccounts =
this.driftClient.getStateAccount().numberOfSubAccounts;
if (!this.disableSyncOnTotalAccountsChange) {
this.driftClient.eventEmitter.on(
'stateAccountUpdate',
this.stateAccountUpdateCallback
);
}
await this.subscription.subscribe();
}
public async addPubkey(
userAccountPublicKey: PublicKey,
userAccount?: UserAccount,
slot?: number,
accountSubscription?: UserSubscriptionConfig
) {
const user = new User({
driftClient: this.driftClient,
userAccountPublicKey,
accountSubscription: accountSubscription ?? {
type: 'custom',
// OneShotUserAccountSubscriber used here so we don't load up the RPC with AccountSubscribes
userAccountSubscriber: new OneShotUserAccountSubscriber(
this.driftClient.program,
userAccountPublicKey,
userAccount,
slot,
this.commitment
),
},
});
await user.subscribe(userAccount);
this.userMap.set(userAccountPublicKey.toString(), {
data: user,
slot: slot ?? user.getUserAccountAndSlot()?.slot,
});
}
public has(key: string): boolean {
return this.userMap.has(key);
}
/**
* gets the User for a particular userAccountPublicKey, if no User exists, undefined is returned
* @param key userAccountPublicKey to get User for
* @returns user User | undefined
*/
public get(key: string): User | undefined {
return this.userMap.get(key)?.data;
}
public getWithSlot(key: string): DataAndSlot<User> | undefined {
return this.userMap.get(key);
}
/**
* gets the User for a particular userAccountPublicKey, if no User exists, new one is created
* @param key userAccountPublicKey to get User for
* @returns User
*/
public async mustGet(
key: string,
accountSubscription?: UserSubscriptionConfig
): Promise<User> {
if (!this.has(key)) {
await this.addPubkey(
new PublicKey(key),
undefined,
undefined,
accountSubscription
);
}
return this.userMap.get(key).data;
}
public async mustGetWithSlot(
key: string,
accountSubscription?: UserSubscriptionConfig
): Promise<DataAndSlot<User>> {
if (!this.has(key)) {
await this.addPubkey(
new PublicKey(key),
undefined,
undefined,
accountSubscription
);
}
return this.userMap.get(key);
}
/**
* gets the Authority for a particular userAccountPublicKey, if no User exists, undefined is returned
* @param key userAccountPublicKey to get User for
* @returns authority PublicKey | undefined
*/
public getUserAuthority(key: string): PublicKey | undefined {
const user = this.userMap.get(key);
if (!user) {
return undefined;
}
return user.data.getUserAccount().authority;
}
/**
* implements the {@link DLOBSource} interface
* create a DLOB from all the subscribed users
* @param slot
*/
public async getDLOB(slot: number): Promise<DLOB> {
const dlob = new DLOB();
await dlob.initFromUserMap(this, slot);
return dlob;
}
public async updateWithOrderRecord(record: OrderRecord) {
if (!this.has(record.user.toString())) {
await this.addPubkey(record.user);
}
}
public async updateWithEventRecord(record: WrappedEvent<any>) {
if (record.eventType === 'DepositRecord') {
const depositRecord = record as DepositRecord;
await this.mustGet(depositRecord.user.toString());
} else if (record.eventType === 'FundingPaymentRecord') {
const fundingPaymentRecord = record as FundingPaymentRecord;
await this.mustGet(fundingPaymentRecord.user.toString());
} else if (record.eventType === 'LiquidationRecord') {
const liqRecord = record as LiquidationRecord;
await this.mustGet(liqRecord.user.toString());
await this.mustGet(liqRecord.liquidator.toString());
} else if (record.eventType === 'OrderRecord') {
const orderRecord = record as OrderRecord;
await this.updateWithOrderRecord(orderRecord);
} else if (record.eventType === 'OrderActionRecord') {
const actionRecord = record as OrderActionRecord;
if (actionRecord.taker) {
await this.mustGet(actionRecord.taker.toString());
}
if (actionRecord.maker) {
await this.mustGet(actionRecord.maker.toString());
}
} else if (record.eventType === 'SettlePnlRecord') {
const settlePnlRecord = record as SettlePnlRecord;
await this.mustGet(settlePnlRecord.user.toString());
} else if (record.eventType === 'NewUserRecord') {
const newUserRecord = record as NewUserRecord;
await this.mustGet(newUserRecord.user.toString());
} else if (record.eventType === 'LPRecord') {
const lpRecord = record as LPRecord;
await this.mustGet(lpRecord.user.toString());
}
}
public *values(): IterableIterator<User> {
for (const dataAndSlot of this.userMap.values()) {
yield dataAndSlot.data;
}
}
public valuesWithSlot(): IterableIterator<DataAndSlot<User>> {
return this.userMap.values();
}
public *entries(): IterableIterator<[string, User]> {
for (const [key, dataAndSlot] of this.userMap.entries()) {
yield [key, dataAndSlot.data];
}
}
public entriesWithSlot(): IterableIterator<[string, DataAndSlot<User>]> {
return this.userMap.entries();
}
public size(): number {
return this.userMap.size;
}
/**
* Returns a unique list of authorities for all users in the UserMap that meet the filter criteria
* @param filterCriteria: Users must meet these criteria to be included
* @returns
*/
public getUniqueAuthorities(
filterCriteria?: UserFilterCriteria
): PublicKey[] {
const usersMeetingCriteria = Array.from(this.values()).filter((user) => {
let pass = true;
if (filterCriteria && filterCriteria.hasOpenOrders) {
pass = pass && user.getUserAccount().hasOpenOrder;
}
return pass;
});
const userAuths = new Set(
usersMeetingCriteria.map((user) =>
user.getUserAccount().authority.toBase58()
)
);
const userAuthKeys = Array.from(userAuths).map(
(userAuth) => new PublicKey(userAuth)
);
return userAuthKeys;
}
public async sync() {
if (this.syncConfig.type === 'default') {
return this.defaultSync();
} else {
return this.paginatedSync();
}
}
private async defaultSync() {
if (this.syncPromise) {
return this.syncPromise;
}
this.syncPromise = new Promise((resolver) => {
this.syncPromiseResolver = resolver;
});
try {
const filters = [getUserFilter()];
if (!this.includeIdle) {
filters.push(getNonIdleUserFilter());
}
if (this.additionalFilters) {
filters.push(...this.additionalFilters);
}
const rpcRequestArgs = [
this.driftClient.program.programId.toBase58(),
{
commitment: this.commitment,
filters,
encoding: 'base64+zstd',
withContext: true,
},
];
// @ts-ignore
const rpcJSONResponse: any = await this.connection._rpcRequest(
'getProgramAccounts',
rpcRequestArgs
);
const rpcResponseAndContext: RpcResponseAndContext<
Array<{ pubkey: PublicKey; account: { data: [string, string] } }>
> = rpcJSONResponse.result;
const slot = rpcResponseAndContext.context.slot;
this.updateLatestSlot(slot);
const programAccountBufferMap = new Map<string, Buffer>();
const decodingPromises = rpcResponseAndContext.value.map(
async (programAccount) => {
const compressedUserData = Buffer.from(
programAccount.account.data[0],
'base64'
);
const decoder = new ZSTDDecoder();
await decoder.init();
const userBuffer = decoder.decode(
compressedUserData,
MAX_USER_ACCOUNT_SIZE_BYTES
);
programAccountBufferMap.set(
programAccount.pubkey.toString(),
Buffer.from(userBuffer)
);
}
);
await Promise.all(decodingPromises);
const promises = Array.from(programAccountBufferMap.entries()).map(
([key, buffer]) =>
(async () => {
const currAccountWithSlot = this.getWithSlot(key);
if (currAccountWithSlot) {
if (slot >= currAccountWithSlot.slot) {
const userAccount = this.decode('User', buffer);
this.updateUserAccount(key, userAccount, slot);
}
} else {
const userAccount = this.decode('User', buffer);
await this.addPubkey(new PublicKey(key), userAccount, slot);
}
})()
);
await Promise.all(promises);
for (const [key] of this.entries()) {
if (!programAccountBufferMap.has(key)) {
const user = this.get(key);
if (user) {
await user.unsubscribe();
this.userMap.delete(key);
}
}
}
} catch (err) {
const e = err as Error;
console.error(`Error in UserMap.sync(): ${e.message} ${e.stack ?? ''}`);
if (this.throwOnFailedSync) {
throw e;
}
} finally {
this.syncPromiseResolver();
this.syncPromise = undefined;
}
}
private async paginatedSync() {
if (this.syncPromise) {
return this.syncPromise;
}
this.syncPromise = new Promise<void>((resolve) => {
this.syncPromiseResolver = resolve;
});
try {
const accountsPrefetch = await this.connection.getProgramAccounts(
this.driftClient.program.programId,
{
dataSlice: { offset: 0, length: 0 },
filters: [
getUserFilter(),
...(!this.includeIdle ? [getNonIdleUserFilter()] : []),
],
}
);
const accountPublicKeys = accountsPrefetch.map(
(account) => account.pubkey
);
const limitConcurrency = async (tasks, limit) => {
const executing = [];
const results = [];
for (let i = 0; i < tasks.length; i++) {
const executor = Promise.resolve().then(tasks[i]);
results.push(executor);
if (executing.length < limit) {
executing.push(executor);
executor.finally(() => {
const index = executing.indexOf(executor);
if (index > -1) {
executing.splice(index, 1);
}
});
} else {
await Promise.race(executing);
}
}
return Promise.all(results);
};
const programAccountBufferMap = new Map<string, Buffer>();
// @ts-ignore
const chunkSize = this.syncConfig.chunkSize ?? 100;
const tasks = [];
for (let i = 0; i < accountPublicKeys.length; i += chunkSize) {
const chunk = accountPublicKeys.slice(i, i + chunkSize);
tasks.push(async () => {
const accountInfos =
await this.connection.getMultipleAccountsInfoAndContext(chunk, {
commitment: this.commitment,
});
const accountInfosSlot = accountInfos.context.slot;
for (let j = 0; j < accountInfos.value.length; j += 1) {
const accountInfo = accountInfos.value[j];
if (accountInfo === null) continue;
const publicKeyString = chunk[j].toString();
const buffer = Buffer.from(accountInfo.data);
programAccountBufferMap.set(publicKeyString, buffer);
const decodedUser = this.decode('User', buffer);
const currAccountWithSlot = this.getWithSlot(publicKeyString);
if (
currAccountWithSlot &&
currAccountWithSlot.slot <= accountInfosSlot
) {
this.updateUserAccount(
publicKeyString,
decodedUser,
accountInfosSlot
);
} else {
await this.addPubkey(
new PublicKey(publicKeyString),
decodedUser,
accountInfosSlot
);
}
}
});
}
// @ts-ignore
const concurrencyLimit = this.syncConfig.concurrencyLimit ?? 10;
await limitConcurrency(tasks, concurrencyLimit);
for (const [key] of this.entries()) {
if (!programAccountBufferMap.has(key)) {
const user = this.get(key);
if (user) {
await user.unsubscribe();
this.userMap.delete(key);
}
}
}
} catch (err) {
console.error(`Error in UserMap.sync():`, err);
if (this.throwOnFailedSync) {
throw err;
}
} finally {
if (this.syncPromiseResolver) {
this.syncPromiseResolver();
}
this.syncPromise = undefined;
}
}
public async unsubscribe() {
await this.subscription.unsubscribe();
for (const [key, user] of this.entries()) {
await user.unsubscribe();
this.userMap.delete(key);
}
if (this.lastNumberOfSubAccounts) {
if (!this.disableSyncOnTotalAccountsChange) {
this.driftClient.eventEmitter.removeListener(
'stateAccountUpdate',
this.stateAccountUpdateCallback
);
}
this.lastNumberOfSubAccounts = undefined;
}
}
public async updateUserAccount(
key: string,
userAccount: UserAccount,
slot: number
) {
const userWithSlot = this.getWithSlot(key);
this.updateLatestSlot(slot);
if (userWithSlot) {
if (slot >= userWithSlot.slot) {
userWithSlot.data.accountSubscriber.updateData(userAccount, slot);
this.userMap.set(key, {
data: userWithSlot.data,
slot,
});
}
} else {
this.addPubkey(new PublicKey(key), userAccount, slot);
}
}
updateLatestSlot(slot: number): void {
this.mostRecentSlot = Math.max(slot, this.mostRecentSlot);
}
public getSlot(): number {
return this.mostRecentSlot;
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/userMap/grpcSubscription.ts
|
import { UserMap } from './userMap';
import { getNonIdleUserFilter, getUserFilter } from '../memcmp';
import { WebSocketProgramAccountSubscriber } from '../accounts/webSocketProgramAccountSubscriber';
import { UserAccount } from '../types';
import { Context, MemcmpFilter, PublicKey } from '@solana/web3.js';
import { GrpcConfigs, ResubOpts } from '../accounts/types';
import { grpcProgramAccountSubscriber } from '../accounts/grpcProgramAccountSubscriber';
export class grpcSubscription {
private grpcConfigs: GrpcConfigs;
private userMap: UserMap;
private skipInitialLoad: boolean;
private resubOpts?: ResubOpts;
private includeIdle?: boolean;
private additionalFilters?: MemcmpFilter[];
private decodeFn: (name: string, data: Buffer) => UserAccount;
private subscriber: WebSocketProgramAccountSubscriber<UserAccount>;
constructor({
grpcConfigs,
userMap,
skipInitialLoad = false,
resubOpts,
includeIdle = false,
decodeFn,
additionalFilters = undefined,
}: {
grpcConfigs: GrpcConfigs;
userMap: UserMap;
skipInitialLoad?: boolean;
resubOpts?: ResubOpts;
includeIdle?: boolean;
decodeFn: (name: string, data: Buffer) => UserAccount;
additionalFilters?: MemcmpFilter[];
}) {
this.userMap = userMap;
this.skipInitialLoad = skipInitialLoad;
this.resubOpts = resubOpts;
this.includeIdle = includeIdle || false;
this.decodeFn = decodeFn;
this.grpcConfigs = grpcConfigs;
this.additionalFilters = additionalFilters;
}
public async subscribe(): Promise<void> {
if (!this.subscriber) {
const filters = [getUserFilter()];
if (!this.includeIdle) {
filters.push(getNonIdleUserFilter());
}
if (this.additionalFilters) {
filters.push(...this.additionalFilters);
}
this.subscriber = new grpcProgramAccountSubscriber<UserAccount>(
this.grpcConfigs,
'UserMap',
'User',
this.userMap.driftClient.program,
this.decodeFn,
{
filters,
},
this.resubOpts
);
}
await this.subscriber.subscribe(
(accountId: PublicKey, account: UserAccount, context: Context) => {
const userKey = accountId.toBase58();
this.userMap.updateUserAccount(userKey, account, context.slot);
}
);
if (!this.skipInitialLoad) {
await this.userMap.sync();
}
}
public async unsubscribe(): Promise<void> {
if (!this.subscriber) return;
await this.subscriber.unsubscribe();
this.subscriber = undefined;
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/factory/bigNum.ts
|
import { BN } from '@coral-xyz/anchor';
import { assert } from '../assert/assert';
import { ZERO } from './../constants/numericConstants';
export class BigNum {
val: BN;
precision: BN;
static delim = '.';
static spacer = ',';
public static setLocale(locale: string): void {
BigNum.delim = (1.1).toLocaleString(locale).slice(1, 2) || '.';
BigNum.spacer = (1000).toLocaleString(locale).slice(1, 2) || ',';
}
constructor(
val: BN | number | string,
precisionVal: BN | number | string = new BN(0)
) {
this.val = new BN(val);
this.precision = new BN(precisionVal);
}
private bigNumFromParam(bn: BigNum | BN) {
return BN.isBN(bn) ? BigNum.from(bn) : bn;
}
public add(bn: BigNum): BigNum {
assert(bn.precision.eq(this.precision), 'Adding unequal precisions');
return BigNum.from(this.val.add(bn.val), this.precision);
}
public sub(bn: BigNum): BigNum {
assert(bn.precision.eq(this.precision), 'Subtracting unequal precisions');
return BigNum.from(this.val.sub(bn.val), this.precision);
}
public mul(bn: BigNum | BN): BigNum {
const mulVal = this.bigNumFromParam(bn);
return BigNum.from(
this.val.mul(mulVal.val),
this.precision.add(mulVal.precision)
);
}
/**
* Multiplies by another big number then scales the result down by the big number's precision so that we're in the same precision space
* @param bn
* @returns
*/
public scalarMul(bn: BigNum | BN): BigNum {
if (BN.isBN(bn)) return BigNum.from(this.val.mul(bn), this.precision);
return BigNum.from(
this.val.mul(bn.val),
this.precision.add(bn.precision)
).shift(bn.precision.neg());
}
public div(bn: BigNum | BN): BigNum {
if (BN.isBN(bn)) return BigNum.from(this.val.div(bn), this.precision);
return BigNum.from(this.val.div(bn.val), this.precision.sub(bn.precision));
}
/**
* Shift precision up or down
* @param exponent
* @param skipAdjustingPrecision
* @returns
*/
public shift(exponent: BN | number, skipAdjustingPrecision = false): BigNum {
const shiftVal = typeof exponent === 'number' ? new BN(exponent) : exponent;
return BigNum.from(
shiftVal.isNeg()
? this.val.div(new BN(10).pow(shiftVal))
: this.val.mul(new BN(10).pow(shiftVal)),
skipAdjustingPrecision ? this.precision : this.precision.add(shiftVal)
);
}
/**
* Shift to a target precision
* @param targetPrecision
* @returns
*/
public shiftTo(targetPrecision: BN): BigNum {
return this.shift(targetPrecision.sub(this.precision));
}
/**
* Scale the number by a fraction
* @param numerator
* @param denominator
* @returns
*/
public scale(numerator: BN | number, denominator: BN | number): BigNum {
return this.mul(BigNum.from(new BN(numerator))).div(new BN(denominator));
}
public toPercentage(denominator: BigNum, precision: number): string {
return this.shift(precision)
.shift(2, true)
.div(denominator)
.toPrecision(precision);
}
public gt(bn: BigNum | BN, ignorePrecision?: boolean): boolean {
const comparisonVal = this.bigNumFromParam(bn);
if (!ignorePrecision && !comparisonVal.eq(ZERO)) {
assert(
comparisonVal.precision.eq(this.precision),
'Trying to compare numbers with different precision. Yo can opt to ignore precision using the ignorePrecision parameter'
);
}
return this.val.gt(comparisonVal.val);
}
public lt(bn: BigNum | BN, ignorePrecision?: boolean): boolean {
const comparisonVal = this.bigNumFromParam(bn);
if (!ignorePrecision && !comparisonVal.val.eq(ZERO)) {
assert(
comparisonVal.precision.eq(this.precision),
'Trying to compare numbers with different precision. Yo can opt to ignore precision using the ignorePrecision parameter'
);
}
return this.val.lt(comparisonVal.val);
}
public gte(bn: BigNum | BN, ignorePrecision?: boolean): boolean {
const comparisonVal = this.bigNumFromParam(bn);
if (!ignorePrecision && !comparisonVal.val.eq(ZERO)) {
assert(
comparisonVal.precision.eq(this.precision),
'Trying to compare numbers with different precision. Yo can opt to ignore precision using the ignorePrecision parameter'
);
}
return this.val.gte(comparisonVal.val);
}
public lte(bn: BigNum | BN, ignorePrecision?: boolean): boolean {
const comparisonVal = this.bigNumFromParam(bn);
if (!ignorePrecision && !comparisonVal.val.eq(ZERO)) {
assert(
comparisonVal.precision.eq(this.precision),
'Trying to compare numbers with different precision. Yo can opt to ignore precision using the ignorePrecision parameter'
);
}
return this.val.lte(comparisonVal.val);
}
public eq(bn: BigNum | BN, ignorePrecision?: boolean): boolean {
const comparisonVal = this.bigNumFromParam(bn);
if (!ignorePrecision && !comparisonVal.val.eq(ZERO)) {
assert(
comparisonVal.precision.eq(this.precision),
'Trying to compare numbers with different precision. Yo can opt to ignore precision using the ignorePrecision parameter'
);
}
return this.val.eq(comparisonVal.val);
}
public eqZero() {
return this.val.eq(ZERO);
}
public gtZero() {
return this.val.gt(ZERO);
}
public ltZero() {
return this.val.lt(ZERO);
}
public gteZero() {
return this.val.gte(ZERO);
}
public lteZero() {
return this.val.lte(ZERO);
}
public abs(): BigNum {
return new BigNum(this.val.abs(), this.precision);
}
public neg(): BigNum {
return new BigNum(this.val.neg(), this.precision);
}
public toString = (base?: number | 'hex', length?: number): string =>
this.val.toString(base, length);
/**
* Pretty print the underlying value in human-readable form. Depends on precision being correct for the output string to be correct
* @returns
*/
public print(): string {
assert(
this.precision.gte(ZERO),
'Tried to print a BN with precision lower than zero'
);
const isNeg = this.isNeg();
const plainString = this.abs().toString();
const precisionNum = this.precision.toNumber();
// make a string with at least the precisionNum number of zeroes
let printString = [
...Array(this.precision.toNumber()).fill(0),
...plainString.split(''),
].join('');
// inject decimal
printString =
printString.substring(0, printString.length - precisionNum) +
BigNum.delim +
printString.substring(printString.length - precisionNum);
// remove leading zeroes
printString = printString.replace(/^0+/, '');
// add zero if leading delim
if (printString[0] === BigNum.delim) printString = `0${printString}`;
// Add minus if negative
if (isNeg) printString = `-${printString}`;
// remove trailing delim
if (printString[printString.length - 1] === BigNum.delim)
printString = printString.slice(0, printString.length - 1);
return printString;
}
public prettyPrint(
useTradePrecision?: boolean,
precisionOverride?: number
): string {
const [leftSide, rightSide] = this.printShort(
useTradePrecision,
precisionOverride
).split(BigNum.delim);
let formattedLeftSide = leftSide;
const isNeg = formattedLeftSide.includes('-');
if (isNeg) {
formattedLeftSide = formattedLeftSide.replace('-', '');
}
let index = formattedLeftSide.length - 3;
while (index >= 1) {
const formattedLeftSideArray = formattedLeftSide.split('');
formattedLeftSideArray.splice(index, 0, BigNum.spacer);
formattedLeftSide = formattedLeftSideArray.join('');
index -= 3;
}
return `${isNeg ? '-' : ''}${formattedLeftSide}${
rightSide ? `${BigNum.delim}${rightSide}` : ''
}`;
}
/**
* Print and remove unnecessary trailing zeroes
* @returns
*/
public printShort(
useTradePrecision?: boolean,
precisionOverride?: number
): string {
const printVal = precisionOverride
? this.toPrecision(precisionOverride)
: useTradePrecision
? this.toTradePrecision()
: this.print();
if (!printVal.includes(BigNum.delim)) return printVal;
return printVal.replace(/0+$/g, '').replace(/\.$/, '').replace(/,$/, '');
}
public debug() {
console.log(
`${this.toString()} | ${this.print()} | ${this.precision.toString()}`
);
}
/**
* Pretty print with the specified number of decimal places
* @param fixedPrecision
* @returns
*/
public toFixed(fixedPrecision: number, rounded = false): string {
if (rounded) {
return this.toRounded(fixedPrecision).toFixed(fixedPrecision);
}
const printString = this.print();
const [leftSide, rightSide] = printString.split(BigNum.delim);
const filledRightSide = [
...(rightSide ?? '').slice(0, fixedPrecision),
...Array(fixedPrecision).fill('0'),
]
.slice(0, fixedPrecision)
.join('');
return `${leftSide}${BigNum.delim}${filledRightSide}`;
}
private getZeroes(count: number) {
return new Array(Math.max(count, 0)).fill('0').join('');
}
public toRounded(roundingPrecision: number) {
const printString = this.toString();
let shouldRoundUp = false;
const roundingDigitChar = printString[roundingPrecision];
if (roundingDigitChar) {
const roundingDigitVal = Number(roundingDigitChar);
if (roundingDigitVal >= 5) shouldRoundUp = true;
}
if (shouldRoundUp) {
const valueWithRoundedPrecisionAdded = this.add(
BigNum.from(
new BN(10).pow(new BN(printString.length - roundingPrecision)),
this.precision
)
);
const roundedUpPrintString =
valueWithRoundedPrecisionAdded.toString().slice(0, roundingPrecision) +
this.getZeroes(printString.length - roundingPrecision);
return BigNum.from(roundedUpPrintString, this.precision);
} else {
const roundedDownPrintString =
printString.slice(0, roundingPrecision) +
this.getZeroes(printString.length - roundingPrecision);
return BigNum.from(roundedDownPrintString, this.precision);
}
}
/**
* Pretty print to the specified number of significant figures
* @param fixedPrecision
* @returns
*/
public toPrecision(
fixedPrecision: number,
trailingZeroes = false,
rounded = false
): string {
if (rounded) {
return this.toRounded(fixedPrecision).toPrecision(
fixedPrecision,
trailingZeroes
);
}
const isNeg = this.isNeg();
const printString = this.abs().print();
const thisString = this.abs().toString();
let precisionPrintString = printString.slice(0, fixedPrecision + 1);
if (
!printString.includes(BigNum.delim) &&
thisString.length < fixedPrecision
) {
const precisionMismatch = fixedPrecision - thisString.length;
return BigNum.from(
(isNeg ? '-' : '') + thisString + this.getZeroes(precisionMismatch),
precisionMismatch
).toPrecision(fixedPrecision, trailingZeroes);
}
if (
!precisionPrintString.includes(BigNum.delim) ||
precisionPrintString[precisionPrintString.length - 1] === BigNum.delim
) {
precisionPrintString = printString.slice(0, fixedPrecision);
}
const pointsOfPrecision = precisionPrintString.replace(
BigNum.delim,
''
).length;
if (pointsOfPrecision < fixedPrecision) {
precisionPrintString = [
...precisionPrintString.split(''),
...Array(fixedPrecision - pointsOfPrecision).fill('0'),
].join('');
}
if (!precisionPrintString.includes(BigNum.delim)) {
const delimFullStringLocation = printString.indexOf(BigNum.delim);
let skipExponent = false;
if (delimFullStringLocation === -1) {
// no decimal, not missing any precision
skipExponent = true;
}
if (
precisionPrintString[precisionPrintString.length - 1] === BigNum.delim
) {
// decimal is at end of string, not missing any precision, do nothing
skipExponent = true;
}
if (printString.indexOf(BigNum.delim) === fixedPrecision) {
// decimal is at end of string, not missing any precision, do nothing
skipExponent = true;
}
if (!skipExponent) {
const exponent = delimFullStringLocation - fixedPrecision;
if (trailingZeroes) {
precisionPrintString = `${precisionPrintString}${Array(exponent)
.fill('0')
.join('')}`;
} else {
precisionPrintString = `${precisionPrintString}e${exponent}`;
}
}
}
return `${isNeg ? '-' : ''}${precisionPrintString}`;
}
public toTradePrecision(rounded = false): string {
return this.toPrecision(6, true, rounded);
}
/**
* Print dollar formatted value. Defaults to fixed decimals two unless a given precision is given.
* @param useTradePrecision
* @param precisionOverride
* @returns
*/
public toNotional(
useTradePrecision?: boolean,
precisionOverride?: number
): string {
const prefix = `${this.lt(BigNum.zero()) ? `-` : ``}$`;
const usingCustomPrecision =
true && (useTradePrecision || precisionOverride);
let val = usingCustomPrecision
? this.prettyPrint(useTradePrecision, precisionOverride)
: BigNum.fromPrint(this.toFixed(2), new BN(2)).prettyPrint();
// Append trailing zeroes out to 2 decimal places if not using custom precision
if (!usingCustomPrecision) {
const [_, rightSide] = val.split(BigNum.delim);
const trailingLength = rightSide?.length ?? 0;
if (trailingLength === 0) {
val = `${val}${BigNum.delim}00`;
} else if (trailingLength === 1) {
val = `${val}0`;
}
}
return `${prefix}${val.replace('-', '')}`;
}
public toMillified(
precision = 3,
rounded = false,
type: 'financial' | 'scientific' = 'financial'
): string {
if (rounded) {
return this.toRounded(precision).toMillified(precision);
}
const isNeg = this.isNeg();
const stringVal = this.abs().print();
const [leftSide] = stringVal.split(BigNum.delim);
if (!leftSide) {
return this.shift(new BN(precision)).toPrecision(precision, true);
}
if (leftSide.length <= precision) {
return this.toPrecision(precision);
}
if (leftSide.length <= 3) {
return this.shift(new BN(precision)).toPrecision(precision, true);
}
const unitTicks =
type === 'financial'
? ['', 'K', 'M', 'B', 'T', 'Q']
: ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
// TODO -- handle nubers which are larger than the max unit tick
const unitNumber = Math.floor((leftSide.length - 1) / 3);
const unit = unitTicks[unitNumber];
let leadDigits = leftSide.slice(0, precision);
if (leadDigits.length < precision) {
leadDigits = [
...leadDigits.split(''),
...Array(precision - leadDigits.length).fill('0'),
].join('');
}
const decimalLocation = leftSide.length - 3 * unitNumber;
let leadString = '';
if (decimalLocation >= precision) {
leadString = `${leadDigits}`;
} else {
leadString = `${leadDigits.slice(0, decimalLocation)}${
BigNum.delim
}${leadDigits.slice(decimalLocation)}`;
}
return `${isNeg ? '-' : ''}${leadString}${unit}`;
}
public toJSON() {
return {
val: this.val.toString(),
precision: this.precision.toString(),
};
}
public isNeg() {
return this.lt(ZERO, true);
}
public isPos() {
return !this.isNeg();
}
/**
* Get the numerical value of the BigNum. This can break if the BigNum is too large.
* @returns
*/
public toNum() {
let printedValue = this.print();
// Must convert any non-US delimiters and spacers to US format before using parseFloat
if (BigNum.delim !== '.' || BigNum.spacer !== ',') {
printedValue = printedValue
.split('')
.map((char) => {
if (char === BigNum.delim) return '.';
if (char === BigNum.spacer) return ',';
return char;
})
.join('');
}
return parseFloat(printedValue);
}
static fromJSON(json: { val: string; precision: string }) {
return BigNum.from(new BN(json.val), new BN(json.precision));
}
/**
* Create a BigNum instance
* @param val
* @param precision
* @returns
*/
static from(
val: BN | number | string = ZERO,
precision?: BN | number | string
): BigNum {
assert(
new BN(precision).lt(new BN(100)),
'Tried to create a bignum with precision higher than 10^100'
);
return new BigNum(val, precision);
}
/**
* Create a BigNum instance from a printed BigNum
* @param val
* @param precisionOverride
* @returns
*/
static fromPrint(val: string, precisionShift?: BN): BigNum {
// Handle empty number edge cases
if (!val) return BigNum.from(ZERO, precisionShift);
if (!val.replace(BigNum.delim, '')) {
return BigNum.from(ZERO, precisionShift);
}
if (val.includes('e'))
val = (+val).toFixed(precisionShift?.toNumber() ?? 9); // prevent small numbers e.g. 3.1e-8, use assume max precision 9 as default
const sides = val.split(BigNum.delim);
const rightSide = sides[1];
const leftSide = sides[0].replace(/\s/g, '');
const bnInput = `${leftSide ?? ''}${rightSide ?? ''}`;
const rawBn = new BN(bnInput);
const rightSideLength = rightSide?.length ?? 0;
const totalShift = precisionShift
? precisionShift.sub(new BN(rightSideLength))
: ZERO;
return BigNum.from(rawBn, precisionShift).shift(totalShift, true);
}
static max(a: BigNum, b: BigNum): BigNum {
return a.gt(b) ? a : b;
}
static min(a: BigNum, b: BigNum): BigNum {
return a.lt(b) ? a : b;
}
static zero(precision?: BN | number): BigNum {
return BigNum.from(0, precision);
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/factory/oracleClient.ts
|
import { isVariant, OracleSource } from '../types';
import { Connection } from '@solana/web3.js';
import { OracleClient } from '../oracles/types';
import { PythClient } from '../oracles/pythClient';
// import { SwitchboardClient } from '../oracles/switchboardClient';
import { QuoteAssetOracleClient } from '../oracles/quoteAssetOracleClient';
import { BN, Program } from '@coral-xyz/anchor';
import { PrelaunchOracleClient } from '../oracles/prelaunchOracleClient';
import { SwitchboardClient } from '../oracles/switchboardClient';
import { PythPullClient } from '../oracles/pythPullClient';
import { SwitchboardOnDemandClient } from '../oracles/switchboardOnDemandClient';
import { PythLazerClient } from '../oracles/pythLazerClient';
export function getOracleClient(
oracleSource: OracleSource,
connection: Connection,
program: Program
): OracleClient {
if (isVariant(oracleSource, 'pyth')) {
return new PythClient(connection);
}
if (isVariant(oracleSource, 'pythPull')) {
return new PythPullClient(connection);
}
if (isVariant(oracleSource, 'pyth1K')) {
return new PythClient(connection, new BN(1000));
}
if (isVariant(oracleSource, 'pyth1KPull')) {
return new PythPullClient(connection, new BN(1000));
}
if (isVariant(oracleSource, 'pyth1M')) {
return new PythClient(connection, new BN(1000000));
}
if (isVariant(oracleSource, 'pyth1MPull')) {
return new PythPullClient(connection, new BN(1000000));
}
if (isVariant(oracleSource, 'pythStableCoin')) {
return new PythClient(connection, undefined, true);
}
if (isVariant(oracleSource, 'pythStableCoinPull')) {
return new PythPullClient(connection, undefined, true);
}
if (isVariant(oracleSource, 'switchboard')) {
return new SwitchboardClient(connection);
}
if (isVariant(oracleSource, 'prelaunch')) {
return new PrelaunchOracleClient(connection, program);
}
if (isVariant(oracleSource, 'quoteAsset')) {
return new QuoteAssetOracleClient();
}
if (isVariant(oracleSource, 'switchboardOnDemand')) {
return new SwitchboardOnDemandClient(connection);
}
if (isVariant(oracleSource, 'pythLazer')) {
return new PythLazerClient(connection);
}
throw new Error(`Unknown oracle source ${oracleSource}`);
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/sdk/src
|
solana_public_repos/drift-labs/protocol-v2/sdk/src/clock/clockSubscriber.ts
|
import { Commitment, Connection, SYSVAR_CLOCK_PUBKEY } from '@solana/web3.js';
import { EventEmitter } from 'events';
import StrictEventEmitter from 'strict-event-emitter-types/types/src';
import { BN } from '..';
// eslint-disable-next-line @typescript-eslint/ban-types
type ClockSubscriberConfig = {
commitment: Commitment;
resubTimeoutMs?: number;
};
export interface ClockSubscriberEvent {
clockUpdate: (ts: number) => void;
}
export class ClockSubscriber {
private _latestSlot: number;
private _currentTs: number;
private subscriptionId: number;
commitment: Commitment;
eventEmitter: StrictEventEmitter<EventEmitter, ClockSubscriberEvent>;
public get latestSlot(): number {
return this._latestSlot;
}
public get currentTs(): number {
return this._currentTs;
}
// Reconnection
private timeoutId?: NodeJS.Timeout;
private resubTimeoutMs?: number;
private isUnsubscribing = false;
private receivingData = false;
public constructor(
private connection: Connection,
config?: ClockSubscriberConfig
) {
this.eventEmitter = new EventEmitter();
this.resubTimeoutMs = config?.resubTimeoutMs;
this.commitment = config?.commitment || 'confirmed';
if (this.resubTimeoutMs < 1000) {
console.log(
'resubTimeoutMs should be at least 1000ms to avoid spamming resub'
);
}
}
public async subscribe(): Promise<void> {
if (this.subscriptionId != null) {
return;
}
this.subscriptionId = this.connection.onAccountChange(
SYSVAR_CLOCK_PUBKEY,
(acctInfo, context) => {
if (!this.latestSlot || this.latestSlot < context.slot) {
if (this.resubTimeoutMs && !this.isUnsubscribing) {
this.receivingData = true;
clearTimeout(this.timeoutId);
this.setTimeout();
}
this._latestSlot = context.slot;
this._currentTs = new BN(
acctInfo.data.subarray(32, 39),
undefined,
'le'
).toNumber();
this.eventEmitter.emit('clockUpdate', this.currentTs);
}
},
this.commitment
);
if (this.resubTimeoutMs) {
this.receivingData = true;
this.setTimeout();
}
}
private setTimeout(): void {
this.timeoutId = setTimeout(async () => {
if (this.isUnsubscribing) {
// If we are in the process of unsubscribing, do not attempt to resubscribe
return;
}
if (this.receivingData) {
console.log(
`No new slot in ${this.resubTimeoutMs}ms, slot subscriber resubscribing`
);
await this.unsubscribe(true);
this.receivingData = false;
await this.subscribe();
}
}, this.resubTimeoutMs);
}
public getUnixTs(): number {
return this.currentTs;
}
public async unsubscribe(onResub = false): Promise<void> {
if (!onResub) {
this.resubTimeoutMs = undefined;
}
this.isUnsubscribing = true;
clearTimeout(this.timeoutId);
this.timeoutId = undefined;
if (this.subscriptionId != null) {
await this.connection.removeAccountChangeListener(this.subscriptionId);
this.subscriptionId = undefined;
this.isUnsubscribing = false;
} else {
this.isUnsubscribing = false;
}
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/deps
|
solana_public_repos/drift-labs/protocol-v2/deps/configs/usdc.json
|
{
"pubkey": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"account": {
"lamports": 1461600,
"data": [
"AQAAANuZX+JRadFByrm7upK6oB+fLh7OffTLKsBRkPN/zB+dAAAAAAAAAAAGAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"base64"
],
"owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"executable": false,
"rentEpoch": 367
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2/deps
|
solana_public_repos/drift-labs/protocol-v2/deps/configs/pyth_lazer_storage.json
|
{
"pubkey": "3rdJbqfnagQ4yx9HXJViD4zc4xpiSqmFsKpPuSCQVyQL",
"account": {
"lamports": 1461600,
"data": [
"0XX/ucSvRAkL/td28gTUmmjn6CkzKyvYXJOMcup4pEKu3cXcP7cvDAH2UhC+5Pz1sc7h5Tf6vP2VAQKXZTuUrwTUVPxHPpSDT+g2BnoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"base64"
],
"owner": "pytd2yyk641x7ak7mkaasSJVXh6YYZnC7wTmtgAyxPt",
"executable": false,
"rentEpoch": 367
}
}
| 0
|
solana_public_repos/drift-labs/protocol-v2
|
solana_public_repos/drift-labs/protocol-v2/test-scripts/single-anchor-test.sh
|
if [ "$1" != "--skip-build" ]
then
anchor build -- --features anchor-test && anchor test --skip-build &&
cp target/idl/drift.json sdk/src/idl/
fi
export ANCHOR_WALLET=~/.config/solana/id.json
test_files=(pythLazerBankrun.ts)
for test_file in ${test_files[@]}; do
ts-mocha -t 300000 ./tests/${test_file}
done
| 0
|
solana_public_repos/drift-labs/protocol-v2
|
solana_public_repos/drift-labs/protocol-v2/test-scripts/run-ts-mocha
|
#!/bin/sh
ts-mocha -t 1000000 ./tests/${ANCHOR_TEST_FILE}
| 0
|
solana_public_repos/drift-labs/protocol-v2
|
solana_public_repos/drift-labs/protocol-v2/test-scripts/run-anchor-tests.sh
|
if [ "$1" != "--skip-build" ]; then
anchor build -- --features anchor-test && anchor test --skip-build &&
cp target/idl/drift.json sdk/src/idl/
fi
export ANCHOR_WALLET=~/.config/solana/id.json
test_files=(
# cappedSymFunding.ts
# delistMarket.ts
# delistMarketLiq.ts
# imbalancePerpPnl.ts
# ksolver.ts
# repegAndSpread.ts
# spotWithdrawUtil100.ts
# updateAMM.ts
# updateK.ts
# postOnlyAmmFulfillment.ts
# TODO BROKEN ^^
fuel.ts
admin.ts
assetTier.ts
cancelAllOrders.ts
curve.ts
deleteInitializedSpotMarket.ts
depositIntoSpotMarketVault.ts
driftClient.ts
fillSpot.ts
insuranceFundStake.ts
liquidateBorrowForPerpPnl.ts
liquidateMaxLps.ts
liquidatePerp.ts
liquidatePerpAndLp.ts
liquidatePerpWithFill.ts
liquidatePerpPnlForDeposit.ts
liquidateSpot.ts
liquidateSpotSocialLoss.ts
liquidityProvider.ts
marketOrder.ts
marketOrderBaseAssetAmount.ts
maxDeposit.ts
maxLeverageOrderParams.ts
modifyOrder.ts
multipleMakerOrders.ts
multipleSpotMakerOrders.ts
openbookTest.ts
oracleDiffSources.ts
oracleFillPriceGuardrails.ts
oracleOffsetOrders.ts
order.ts
ordersWithSpread.ts
pauseExchange.ts
perpLpJit.ts
perpLpRiskMitigation.ts
phoenixTest.ts
placeAndMakePerp.ts
placeAndMakeSwiftPerpBankrun.ts
placeAndMakeSpotOrder.ts
postOnly.ts
prelisting.ts
pyth.ts
pythPull.ts
pythLazerBankrun.ts
referrer.ts
rfq.ts
roundInFavorBaseAsset.ts
serumTest.ts
spotDepositWithdraw.ts
spotDepositWithdraw22.ts
spotMarketPoolIds.ts
spotSwap.ts
spotSwap22.ts
stopLimits.ts
subaccounts.ts
surgePricing.ts
switchboardTxCus.ts
switchOracle.ts
tradingLP.ts
triggerOrders.ts
triggerSpotOrder.ts
userAccount.ts
userDelegate.ts
userOrderId.ts
whitelist.ts
)
for test_file in ${test_files[@]}; do
ts-mocha -t 300000 ./tests/${test_file} || exit 1
done
| 0
|
solana_public_repos/drift-labs/protocol-v2
|
solana_public_repos/drift-labs/protocol-v2/test-scripts/run-anchor-local-validator-tests.sh
|
if [ "$1" != "--skip-build" ]; then
anchor build -- --features anchor-test &&
cp target/idl/drift.json sdk/src/idl/
fi
export ANCHOR_WALLET=~/.config/solana/id.json
test_files=(
#placeAndMakeSwiftPerp.ts,
pythLazer.ts
)
for test_file in ${test_files[@]}; do
export ANCHOR_TEST_FILE=${test_file} && anchor test --skip-build || exit 1
done
| 0
|
solana_public_repos/drift-labs
|
solana_public_repos/drift-labs/keeper-bots-v2/jitMaker.config.yaml
|
global:
# devnet or mainnet-beta
driftEnv: mainnet-beta
# RPC endpoint to use
endpoint:
# custom websocket endpoint to use (if null will be determined from rpc endpoint)
wsEndpoint:
resubTimeoutMs: 10000 # timeout for resubscribing to websocket
# Private key to use to sign transactions.
# will load from KEEPER_PRIVATE_KEY env var if null
keeperPrivateKey:
initUser: false # initialize user on startup
testLiveness: false # test liveness, by failing liveness test after 1 min
# Force deposit this amount of USDC to collateral account, the program will
# end after the deposit transaction is sent
#forceDeposit: 1000
websocket: true # use websocket for account loading and events (limited support)
runOnce: false # Set true to run once and exit, useful for testing or one off bot runs
debug: false # Enable debug logging
eventSubscriberPollingInterval: 0
bulkAccountLoaderPollingInterval: 0
useJito: false
jitoBlockEngineUrl: frankfurt.mainnet.block-engine.jito.wtf
jitoAuthPrivateKey: /path/to/jito/bundle/signing/key/auth.json
# which subaccounts to load and get info for, if null will load subaccount 0 (default)
subaccounts: [0]
# Which bots to run, be careful with this, running multiple bots in one instance
# might use more resources than expected.
# Bot specific configs are below
enabledBots:
# Perp order filler bot
# - filler
# Spot order filler bot
# - spotFiller
# Trigger bot (triggers trigger orders)
# - trigger
# Liquidator bot, liquidates unhealthy positions by taking over the risk (caution, you should manage risk here)
# - liquidator
# Example maker bot that participates in JIT auction (caution: you will probably lose money)
- jitMaker
# Example maker bot that posts floating oracle orders
# - floatingMaker
# settles PnLs for the insurance fund (may want to run with runOnce: true)
# - ifRevenueSettler
# settles negative PnLs for users (may want to run with runOnce: true)
# - userPnlSettler
# uncross the book to capture an arb
# - uncrossArb
# below are bot configs
botConfigs:
jitMaker:
botId: "jitMaker"
dryRun: false
# below, ordering is important: match the subaccountIds to perpMarketindices.
# e.g. to MM perp markets 0, 1 both on subaccount 0, then subaccounts=[0,0], perpMarketIndicies=[0,1]
# to MM perp market 0 on subaccount 0 and perp market 1 on subaccount 1, then subaccounts=[0, 1], perpMarketIndicies=[0, 1]
# also, make sure all subaccounts are loaded in the global config subaccounts above to avoid errors
subaccounts: [0]
perpMarketIndicies: [0]
marketType: PERP
# uncrossArb:
# botId: "uncrossArb"
# dryRun: false
# driftEnv: "mainnet-beta"
| 0
|
solana_public_repos/drift-labs
|
solana_public_repos/drift-labs/keeper-bots-v2/jit-maker-config.yaml
|
global:
driftEnv: mainnet-beta
endpoint:
wsEndpoint:
# Private key to use to sign transactions.
# will load from KEEPER_PRIVATE_KEY env var if null
keeperPrivateKey:
initUser: false # set to true if you are starting with a fresh keypair and want to initialize a user
testLiveness: false # test liveness, by failing liveness test after 1 min
cancelOpenOrders: false # cancel open orders on startup
closeOpenPositions: false # close all open positions
websocket: true # use websocket for account loading and events (limited support)
resubTimeoutMs: 30000
debug: false # Enable debug logging
# subaccountIDs to load, if null will load subaccount 0 (default).
subaccounts:
- 0
maxPriorityFeeMicroLamports: 100000
# Which bots to run, be careful with this, running multiple bots in one instance
# might use more resources than expected.
# Bot specific configs are below
enabledBots:
- jitMaker
# below are bot configs
botConfigs:
jitMaker:
botId: "jitMaker"
dryRun: false # no effect for jit maker
metricsPort: 9464
# will jit make on perp market 20 (JTO-PERP) on subaccount 0
marketType: "perp"
marketIndexes:
- 1
subaccounts:
- 2
# bot will try to buy 30 bps above the best bid, and sell 30 bps below the best bid.
aggressivenessBps: 100
# CU limit to set for jit fill, you might need to increase it
# if your account has many positions
jitCULimit: 800000
| 0
|
solana_public_repos/drift-labs
|
solana_public_repos/drift-labs/keeper-bots-v2/LICENSE
|
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2021 Drift Labs
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
| 0
|
solana_public_repos/drift-labs
|
solana_public_repos/drift-labs/keeper-bots-v2/Dockerfile
|
FROM public.ecr.aws/bitnami/node:20.18.1
RUN apt-get install git
ENV NODE_ENV=production
RUN npm install -g typescript
RUN npm install -g ts-node
WORKDIR /app
COPY . .
RUN yarn install
RUN yarn build
RUN yarn install --production
EXPOSE 9464
CMD [ "yarn", "start:all" ]
| 0
|
solana_public_repos/drift-labs
|
solana_public_repos/drift-labs/keeper-bots-v2/.prettierignore
|
**/node_modules/**
protocol
| 0
|
solana_public_repos/drift-labs
|
solana_public_repos/drift-labs/keeper-bots-v2/yarn.lock
|
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@aashutoshrathi/word-wrap@^1.2.3":
version "1.2.6"
resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf"
integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==
"@babel/code-frame@7.12.11":
version "7.12.11"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f"
integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==
dependencies:
"@babel/highlight" "^7.10.4"
"@babel/helper-validator-identifier@^7.22.20":
version "7.22.20"
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0"
integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==
"@babel/highlight@^7.10.4":
version "7.23.4"
resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.23.4.tgz#edaadf4d8232e1a961432db785091207ead0621b"
integrity sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==
dependencies:
"@babel/helper-validator-identifier" "^7.22.20"
chalk "^2.4.2"
js-tokens "^4.0.0"
"@babel/runtime@^7.10.5", "@babel/runtime@^7.12.5", "@babel/runtime@^7.17.2", "@babel/runtime@^7.23.4":
version "7.24.4"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.4.tgz#de795accd698007a66ba44add6cc86542aff1edd"
integrity sha512-dkxf7+hn8mFBwKjs9bvBlArzLVxVbS8usaPUDd5p2a9JCL9tB8OaOVN1isD4+Xyk4ns89/xeOmbQvgdK7IIVdA==
dependencies:
regenerator-runtime "^0.14.0"
"@babel/runtime@^7.15.4", "@babel/runtime@^7.24.6", "@babel/runtime@^7.24.7":
version "7.24.7"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.7.tgz#f4f0d5530e8dbdf59b3451b9b3e594b6ba082e12"
integrity sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==
dependencies:
regenerator-runtime "^0.14.0"
"@babel/runtime@^7.24.8":
version "7.24.8"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.8.tgz#5d958c3827b13cc6d05e038c07fb2e5e3420d82e"
integrity sha512-5F7SDGs1T72ZczbRwbGO9lQi0NLjQxzl6i4lJxLxfW9U5UluCSyEJeniWvnhl3/euNiqQVbo8zruhsDfid0esA==
dependencies:
regenerator-runtime "^0.14.0"
"@brokerloop/ttlcache@^3.2.3":
version "3.2.3"
resolved "https://registry.yarnpkg.com/@brokerloop/ttlcache/-/ttlcache-3.2.3.tgz#bc3c79bb381f7b43f83745eb96e86673f75d3d11"
integrity sha512-kZWoyJGBYTv1cL5oHBYEixlJysJBf2RVnub3gbclD+dwaW9aKubbHzbZ9q1q6bONosxaOqMsoBorOrZKzBDiqg==
dependencies:
"@soncodi/signal" "~2.0.7"
"@colors/colors@1.6.0", "@colors/colors@^1.6.0":
version "1.6.0"
resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.6.0.tgz#ec6cd237440700bc23ca23087f513c75508958b0"
integrity sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==
"@coral-xyz/anchor-30@npm:@coral-xyz/anchor@0.30.1":
version "0.30.1"
resolved "https://registry.yarnpkg.com/@coral-xyz/anchor/-/anchor-0.30.1.tgz#17f3e9134c28cd0ea83574c6bab4e410bcecec5d"
integrity sha512-gDXFoF5oHgpriXAaLpxyWBHdCs8Awgf/gLHIo6crv7Aqm937CNdY+x+6hoj7QR5vaJV7MxWSQ0NGFzL3kPbWEQ==
dependencies:
"@coral-xyz/anchor-errors" "^0.30.1"
"@coral-xyz/borsh" "^0.30.1"
"@noble/hashes" "^1.3.1"
"@solana/web3.js" "^1.68.0"
bn.js "^5.1.2"
bs58 "^4.0.1"
buffer-layout "^1.2.2"
camelcase "^6.3.0"
cross-fetch "^3.1.5"
crypto-hash "^1.3.0"
eventemitter3 "^4.0.7"
pako "^2.0.3"
snake-case "^3.0.4"
superstruct "^0.15.4"
toml "^3.0.0"
"@coral-xyz/anchor-errors@^0.30.1":
version "0.30.1"
resolved "https://registry.yarnpkg.com/@coral-xyz/anchor-errors/-/anchor-errors-0.30.1.tgz#bdfd3a353131345244546876eb4afc0e125bec30"
integrity sha512-9Mkradf5yS5xiLWrl9WrpjqOrAV+/W2RQHDlbnAZBivoGpOs1ECjoDCkVk4aRG8ZdiFiB8zQEVlxf+8fKkmSfQ==
"@coral-xyz/anchor@0.26.0":
version "0.26.0"
resolved "https://registry.yarnpkg.com/@coral-xyz/anchor/-/anchor-0.26.0.tgz#c8e4f7177e93441afd030f22d777d54d0194d7d1"
integrity sha512-PxRl+wu5YyptWiR9F2MBHOLLibm87Z4IMUBPreX+DYBtPM+xggvcPi0KAN7+kIL4IrIhXI8ma5V0MCXxSN1pHg==
dependencies:
"@coral-xyz/borsh" "^0.26.0"
"@solana/web3.js" "^1.68.0"
base64-js "^1.5.1"
bn.js "^5.1.2"
bs58 "^4.0.1"
buffer-layout "^1.2.2"
camelcase "^6.3.0"
cross-fetch "^3.1.5"
crypto-hash "^1.3.0"
eventemitter3 "^4.0.7"
js-sha256 "^0.9.0"
pako "^2.0.3"
snake-case "^3.0.4"
superstruct "^0.15.4"
toml "^3.0.0"
"@coral-xyz/anchor@0.29.0", "@coral-xyz/anchor@^0.29.0":
version "0.29.0"
resolved "https://registry.yarnpkg.com/@coral-xyz/anchor/-/anchor-0.29.0.tgz#bd0be95bedfb30a381c3e676e5926124c310ff12"
integrity sha512-eny6QNG0WOwqV0zQ7cs/b1tIuzZGmP7U7EcH+ogt4Gdbl8HDmIYVMh/9aTmYZPaFWjtUaI8qSn73uYEXWfATdA==
dependencies:
"@coral-xyz/borsh" "^0.29.0"
"@noble/hashes" "^1.3.1"
"@solana/web3.js" "^1.68.0"
bn.js "^5.1.2"
bs58 "^4.0.1"
buffer-layout "^1.2.2"
camelcase "^6.3.0"
cross-fetch "^3.1.5"
crypto-hash "^1.3.0"
eventemitter3 "^4.0.7"
pako "^2.0.3"
snake-case "^3.0.4"
superstruct "^0.15.4"
toml "^3.0.0"
"@coral-xyz/borsh@^0.26.0":
version "0.26.0"
resolved "https://registry.yarnpkg.com/@coral-xyz/borsh/-/borsh-0.26.0.tgz#d054f64536d824634969e74138f9f7c52bbbc0d5"
integrity sha512-uCZ0xus0CszQPHYfWAqKS5swS1UxvePu83oOF+TWpUkedsNlg6p2p4azxZNSSqwXb9uXMFgxhuMBX9r3Xoi0vQ==
dependencies:
bn.js "^5.1.2"
buffer-layout "^1.2.0"
"@coral-xyz/borsh@^0.29.0":
version "0.29.0"
resolved "https://registry.yarnpkg.com/@coral-xyz/borsh/-/borsh-0.29.0.tgz#79f7045df2ef66da8006d47f5399c7190363e71f"
integrity sha512-s7VFVa3a0oqpkuRloWVPdCK7hMbAMY270geZOGfCnaqexrP5dTIpbEHL33req6IYPPJ0hYa71cdvJ1h6V55/oQ==
dependencies:
bn.js "^5.1.2"
buffer-layout "^1.2.0"
"@coral-xyz/borsh@^0.30.1":
version "0.30.1"
resolved "https://registry.yarnpkg.com/@coral-xyz/borsh/-/borsh-0.30.1.tgz#869d8833abe65685c72e9199b8688477a4f6b0e3"
integrity sha512-aaxswpPrCFKl8vZTbxLssA2RvwX2zmKLlRCIktJOwW+VpVwYtXRtlWiIP+c2pPRKneiTiWCN2GEMSH9j1zTlWQ==
dependencies:
bn.js "^5.1.2"
buffer-layout "^1.2.0"
"@cspotcode/source-map-support@^0.8.0":
version "0.8.1"
resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1"
integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==
dependencies:
"@jridgewell/trace-mapping" "0.3.9"
"@dabh/diagnostics@^2.0.2":
version "2.0.3"
resolved "https://registry.yarnpkg.com/@dabh/diagnostics/-/diagnostics-2.0.3.tgz#7f7e97ee9a725dffc7808d93668cc984e1dc477a"
integrity sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==
dependencies:
colorspace "1.1.x"
enabled "2.0.x"
kuler "^2.0.0"
"@drift-labs/jit-proxy@0.12.13":
version "0.12.13"
resolved "https://registry.yarnpkg.com/@drift-labs/jit-proxy/-/jit-proxy-0.12.13.tgz#5b728e12b523350b89db710498c32ee4a12b2443"
integrity sha512-iXtZ5/Ln7SVHi8gS+NAVY4y394jvynb7ueccEAbru38OTfsrB4J/ejepAQrs7x3dz8bjARoHpmZod5lD18YQAw==
dependencies:
"@coral-xyz/anchor" "0.26.0"
"@drift-labs/sdk" "2.104.0-beta.23"
"@solana/web3.js" "1.91.7"
"@drift-labs/sdk@2.104.0-beta.23":
version "2.104.0-beta.23"
resolved "https://registry.yarnpkg.com/@drift-labs/sdk/-/sdk-2.104.0-beta.23.tgz#7d20bde8079aafcfa42448aaa6f88b9de40751d4"
integrity sha512-1xok0cxi6v63Y6jD4i3TDJ1SH7TNbaFvdSmGylNaa8b50B04Q3oPI64jKOJoy9ECdyWt2wDkOxEvw6YusGGwJA==
dependencies:
"@coral-xyz/anchor" "0.29.0"
"@coral-xyz/anchor-30" "npm:@coral-xyz/anchor@0.30.1"
"@ellipsis-labs/phoenix-sdk" "1.4.5"
"@grpc/grpc-js" "^1.8.0"
"@openbook-dex/openbook-v2" "0.2.10"
"@project-serum/serum" "0.13.65"
"@pythnetwork/client" "2.5.3"
"@pythnetwork/price-service-sdk" "1.7.1"
"@pythnetwork/pyth-solana-receiver" "0.7.0"
"@solana/spl-token" "0.3.7"
"@solana/web3.js" "1.92.3"
"@switchboard-xyz/on-demand" "1.2.42"
"@triton-one/yellowstone-grpc" "1.3.0"
anchor-bankrun "0.3.0"
node-cache "5.1.2"
rpc-websockets "7.5.1"
solana-bankrun "0.3.1"
strict-event-emitter-types "2.0.0"
tweetnacl "1.0.3"
uuid "8.3.2"
yargs "17.7.2"
zstddec "0.1.0"
"@ellipsis-labs/phoenix-sdk@1.4.5":
version "1.4.5"
resolved "https://registry.yarnpkg.com/@ellipsis-labs/phoenix-sdk/-/phoenix-sdk-1.4.5.tgz#42cf8de8463b32c910ab8844eae71ca082a6773a"
integrity sha512-vEYgMXuV5/mpnpEi+VK4HO8f6SheHtVLdHHlULBiDN1eECYmL67gq+/cRV7Ar6jAQ7rJZL7xBxhbUW5kugMl6A==
dependencies:
"@metaplex-foundation/beet" "^0.7.1"
"@metaplex-foundation/rustbin" "^0.3.1"
"@metaplex-foundation/solita" "^0.12.2"
"@solana/spl-token" "^0.3.7"
"@types/node" "^18.11.13"
bn.js "^5.2.1"
borsh "^0.7.0"
bs58 "^5.0.0"
"@eslint-community/eslint-utils@^4.2.0":
version "4.4.0"
resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59"
integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==
dependencies:
eslint-visitor-keys "^3.3.0"
"@eslint-community/regexpp@^4.4.0":
version "4.10.0"
resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.10.0.tgz#548f6de556857c8bb73bbee70c35dc82a2e74d63"
integrity sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==
"@eslint/eslintrc@^0.4.3":
version "0.4.3"
resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c"
integrity sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==
dependencies:
ajv "^6.12.4"
debug "^4.1.1"
espree "^7.3.0"
globals "^13.9.0"
ignore "^4.0.6"
import-fresh "^3.2.1"
js-yaml "^3.13.1"
minimatch "^3.0.4"
strip-json-comments "^3.1.1"
"@fastify/ajv-compiler@^1.0.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@fastify/ajv-compiler/-/ajv-compiler-1.1.0.tgz#5ce80b1fc8bebffc8c5ba428d5e392d0f9ed10a1"
integrity sha512-gvCOUNpXsWrIQ3A4aXCLIdblL0tDq42BG/2Xw7oxbil9h11uow10ztS2GuFazNBfjbrsZ5nl+nPl5jDSjj5TSg==
dependencies:
ajv "^6.12.6"
"@fastify/error@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@fastify/error/-/error-2.0.0.tgz#a9f94af56eb934f0ab1ce4ef9f0ced6ebf2319dc"
integrity sha512-wI3fpfDT0t7p8E6dA2eTECzzOd+bZsZCJ2Hcv+Onn2b7ZwK3RwD27uW2QDaMtQhAfWQQP+WNK7nKf0twLsBf9w==
"@grpc/grpc-js@^1.8.0":
version "1.12.2"
resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.12.2.tgz#97eda82dd49bb9c24eaf6434ea8d7de446e95aac"
integrity sha512-bgxdZmgTrJZX50OjyVwz3+mNEnCTNkh3cIqGPWVNeW9jX6bn1ZkU80uPd+67/ZpIJIjRQ9qaHCjhavyoWYxumg==
dependencies:
"@grpc/proto-loader" "^0.7.13"
"@js-sdsl/ordered-map" "^4.4.2"
"@grpc/grpc-js@^1.8.13":
version "1.9.12"
resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.9.12.tgz#a45b23a7d9ee1eadc9fa8fe480e27edbc6544cdd"
integrity sha512-Um5MBuge32TS3lAKX02PGCnFM4xPT996yLgZNb5H03pn6NyJ4Iwn5YcPq6Jj9yxGRk7WOgaZFtVRH5iTdYBeUg==
dependencies:
"@grpc/proto-loader" "^0.7.8"
"@types/node" ">=12.12.47"
"@grpc/proto-loader@^0.7.13":
version "0.7.13"
resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.7.13.tgz#f6a44b2b7c9f7b609f5748c6eac2d420e37670cf"
integrity sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw==
dependencies:
lodash.camelcase "^4.3.0"
long "^5.0.0"
protobufjs "^7.2.5"
yargs "^17.7.2"
"@grpc/proto-loader@^0.7.8":
version "0.7.10"
resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.7.10.tgz#6bf26742b1b54d0a473067743da5d3189d06d720"
integrity sha512-CAqDfoaQ8ykFd9zqBDn4k6iWT9loLAlc2ETmDFS9JCD70gDcnA4L3AFEo2iV7KyAtAAHFW9ftq1Fz+Vsgq80RQ==
dependencies:
lodash.camelcase "^4.3.0"
long "^5.0.0"
protobufjs "^7.2.4"
yargs "^17.7.2"
"@hapi/b64@5.x.x":
version "5.0.0"
resolved "https://registry.yarnpkg.com/@hapi/b64/-/b64-5.0.0.tgz#b8210cbd72f4774985e78569b77e97498d24277d"
integrity sha512-ngu0tSEmrezoiIaNGG6rRvKOUkUuDdf4XTPnONHGYfSGRmDqPZX5oJL6HAdKTo1UQHECbdB4OzhWrfgVppjHUw==
dependencies:
"@hapi/hoek" "9.x.x"
"@hapi/boom@9.x.x", "@hapi/boom@^9.0.0":
version "9.1.4"
resolved "https://registry.yarnpkg.com/@hapi/boom/-/boom-9.1.4.tgz#1f9dad367c6a7da9f8def24b4a986fc5a7bd9db6"
integrity sha512-Ls1oH8jaN1vNsqcaHVYJrKmgMcKsC1wcp8bujvXrHaAqD2iDYq3HoOwsxwo09Cuda5R5nC0o0IxlrlTuvPuzSw==
dependencies:
"@hapi/hoek" "9.x.x"
"@hapi/bourne@2.x.x":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@hapi/bourne/-/bourne-2.1.0.tgz#66aff77094dc3080bd5df44ec63881f2676eb020"
integrity sha512-i1BpaNDVLJdRBEKeJWkVO6tYX6DMFBuwMhSuWqLsY4ufeTKGVuV5rBsUhxPayXqnnWHgXUAmWK16H/ykO5Wj4Q==
"@hapi/cryptiles@5.x.x":
version "5.1.0"
resolved "https://registry.yarnpkg.com/@hapi/cryptiles/-/cryptiles-5.1.0.tgz#655de4cbbc052c947f696148c83b187fc2be8f43"
integrity sha512-fo9+d1Ba5/FIoMySfMqPBR/7Pa29J2RsiPrl7bkwo5W5o+AN1dAYQRi4SPrPwwVxVGKjgLOEWrsvt1BonJSfLA==
dependencies:
"@hapi/boom" "9.x.x"
"@hapi/hoek@9.x.x", "@hapi/hoek@^9.0.0":
version "9.3.0"
resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.3.0.tgz#8368869dcb735be2e7f5cb7647de78e167a251fb"
integrity sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==
"@hapi/iron@^6.0.0":
version "6.0.0"
resolved "https://registry.yarnpkg.com/@hapi/iron/-/iron-6.0.0.tgz#ca3f9136cda655bdd6028de0045da0de3d14436f"
integrity sha512-zvGvWDufiTGpTJPG1Y/McN8UqWBu0k/xs/7l++HVU535NLHXsHhy54cfEMdW7EjwKfbBfM9Xy25FmTiobb7Hvw==
dependencies:
"@hapi/b64" "5.x.x"
"@hapi/boom" "9.x.x"
"@hapi/bourne" "2.x.x"
"@hapi/cryptiles" "5.x.x"
"@hapi/hoek" "9.x.x"
"@hapi/podium@^4.1.3":
version "4.1.3"
resolved "https://registry.yarnpkg.com/@hapi/podium/-/podium-4.1.3.tgz#91e20838fc2b5437f511d664aabebbb393578a26"
integrity sha512-ljsKGQzLkFqnQxE7qeanvgGj4dejnciErYd30dbrYzUOF/FyS/DOF97qcrT3bhoVwCYmxa6PEMhxfCPlnUcD2g==
dependencies:
"@hapi/hoek" "9.x.x"
"@hapi/teamwork" "5.x.x"
"@hapi/validate" "1.x.x"
"@hapi/teamwork@5.x.x":
version "5.1.1"
resolved "https://registry.yarnpkg.com/@hapi/teamwork/-/teamwork-5.1.1.tgz#4d2ba3cac19118a36c44bf49a3a47674de52e4e4"
integrity sha512-1oPx9AE5TIv+V6Ih54RP9lTZBso3rP8j4Xhb6iSVwPXtAM+sDopl5TFMv5Paw73UnpZJ9gjcrTE1BXrWt9eQrg==
"@hapi/topo@^5.0.0":
version "5.1.0"
resolved "https://registry.yarnpkg.com/@hapi/topo/-/topo-5.1.0.tgz#dc448e332c6c6e37a4dc02fd84ba8d44b9afb012"
integrity sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==
dependencies:
"@hapi/hoek" "^9.0.0"
"@hapi/validate@1.x.x":
version "1.1.3"
resolved "https://registry.yarnpkg.com/@hapi/validate/-/validate-1.1.3.tgz#f750a07283929e09b51aa16be34affb44e1931ad"
integrity sha512-/XMR0N0wjw0Twzq2pQOzPBZlDzkekGcoCtzO314BpIEsbXdYGthQUbxgkGDf4nhk1+IPDAsXqWjMohRQYO06UA==
dependencies:
"@hapi/hoek" "^9.0.0"
"@hapi/topo" "^5.0.0"
"@humanwhocodes/config-array@^0.5.0":
version "0.5.0"
resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9"
integrity sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==
dependencies:
"@humanwhocodes/object-schema" "^1.2.0"
debug "^4.1.1"
minimatch "^3.0.4"
"@humanwhocodes/object-schema@^1.2.0":
version "1.2.1"
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45"
integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==
"@jridgewell/resolve-uri@^3.0.3":
version "3.1.1"
resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721"
integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==
"@jridgewell/sourcemap-codec@^1.4.10":
version "1.4.15"
resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32"
integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==
"@jridgewell/trace-mapping@0.3.9":
version "0.3.9"
resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9"
integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==
dependencies:
"@jridgewell/resolve-uri" "^3.0.3"
"@jridgewell/sourcemap-codec" "^1.4.10"
"@js-sdsl/ordered-map@^4.4.2":
version "4.4.2"
resolved "https://registry.yarnpkg.com/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz#9299f82874bab9e4c7f9c48d865becbfe8d6907c"
integrity sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==
"@metaplex-foundation/beet-solana@^0.3.0":
version "0.3.1"
resolved "https://registry.yarnpkg.com/@metaplex-foundation/beet-solana/-/beet-solana-0.3.1.tgz#4b37cda5c7f32ffd2bdd8b3164edc05c6463ab35"
integrity sha512-tgyEl6dvtLln8XX81JyBvWjIiEcjTkUwZbrM5dIobTmoqMuGewSyk9CClno8qsMsFdB5T3jC91Rjeqmu/6xk2g==
dependencies:
"@metaplex-foundation/beet" ">=0.1.0"
"@solana/web3.js" "^1.56.2"
bs58 "^5.0.0"
debug "^4.3.4"
"@metaplex-foundation/beet@>=0.1.0", "@metaplex-foundation/beet@^0.7.1":
version "0.7.2"
resolved "https://registry.yarnpkg.com/@metaplex-foundation/beet/-/beet-0.7.2.tgz#fa4726e4cfd4fb6fed6cddc9b5213c1c2a2d0b77"
integrity sha512-K+g3WhyFxKPc0xIvcIjNyV1eaTVJTiuaHZpig7Xx0MuYRMoJLLvhLTnUXhFdR5Tu2l2QSyKwfyXDgZlzhULqFg==
dependencies:
ansicolors "^0.3.2"
assert "^2.1.0"
bn.js "^5.2.0"
debug "^4.3.3"
"@metaplex-foundation/beet@^0.4.0":
version "0.4.0"
resolved "https://registry.yarnpkg.com/@metaplex-foundation/beet/-/beet-0.4.0.tgz#eb2a0a6eb084bb25d67dd9bed2f7387ee7e63a55"
integrity sha512-2OAKJnLatCc3mBXNL0QmWVQKAWK2C7XDfepgL0p/9+8oSx4bmRAFHFqptl1A/C0U5O3dxGwKfmKluW161OVGcA==
dependencies:
ansicolors "^0.3.2"
bn.js "^5.2.0"
debug "^4.3.3"
"@metaplex-foundation/rustbin@^0.3.0", "@metaplex-foundation/rustbin@^0.3.1":
version "0.3.5"
resolved "https://registry.yarnpkg.com/@metaplex-foundation/rustbin/-/rustbin-0.3.5.tgz#56d028afd96c2b56ad3bbea22ff454adde900e8c"
integrity sha512-m0wkRBEQB/8krwMwKBvFugufZtYwMXiGHud2cTDAv+aGXK4M90y0Hx67/wpu+AqqoQfdV8VM9YezUOHKD+Z5kA==
dependencies:
debug "^4.3.3"
semver "^7.3.7"
text-table "^0.2.0"
toml "^3.0.0"
"@metaplex-foundation/solita@^0.12.2":
version "0.12.2"
resolved "https://registry.yarnpkg.com/@metaplex-foundation/solita/-/solita-0.12.2.tgz#13ef213ac183c986f6d01c5d981c44e59a900834"
integrity sha512-oczMfE43NNHWweSqhXPTkQBUbap/aAiwjDQw8zLKNnd/J8sXr/0+rKcN5yJIEgcHeKRkp90eTqkmt2WepQc8yw==
dependencies:
"@metaplex-foundation/beet" "^0.4.0"
"@metaplex-foundation/beet-solana" "^0.3.0"
"@metaplex-foundation/rustbin" "^0.3.0"
"@solana/web3.js" "^1.36.0"
camelcase "^6.2.1"
debug "^4.3.3"
js-sha256 "^0.9.0"
prettier "^2.5.1"
snake-case "^3.0.4"
spok "^1.4.3"
"@noble/curves@^1.0.0", "@noble/curves@^1.2.0", "@noble/curves@^1.4.0":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.4.0.tgz#f05771ef64da724997f69ee1261b2417a49522d6"
integrity sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg==
dependencies:
"@noble/hashes" "1.4.0"
"@noble/curves@^1.4.2":
version "1.4.2"
resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.4.2.tgz#40309198c76ed71bc6dbf7ba24e81ceb4d0d1fe9"
integrity sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==
dependencies:
"@noble/hashes" "1.4.0"
"@noble/ed25519@^1.7.1":
version "1.7.3"
resolved "https://registry.yarnpkg.com/@noble/ed25519/-/ed25519-1.7.3.tgz#57e1677bf6885354b466c38e2b620c62f45a7123"
integrity sha512-iR8GBkDt0Q3GyaVcIu7mSsVIqnFbkbRzGLWlvhwunacoLwt4J3swfKhfaM6rN6WY+TBGoYT1GtT1mIh2/jGbRQ==
"@noble/hashes@1.4.0", "@noble/hashes@^1.3.0", "@noble/hashes@^1.3.1", "@noble/hashes@^1.3.3", "@noble/hashes@^1.4.0":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.4.0.tgz#45814aa329f30e4fe0ba49426f49dfccdd066426"
integrity sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==
"@nodelib/fs.scandir@2.1.5":
version "2.1.5"
resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5"
integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==
dependencies:
"@nodelib/fs.stat" "2.0.5"
run-parallel "^1.1.9"
"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2":
version "2.0.5"
resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b"
integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==
"@nodelib/fs.walk@^1.2.3":
version "1.2.8"
resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a"
integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==
dependencies:
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"
"@openbook-dex/openbook-v2@0.2.10":
version "0.2.10"
resolved "https://registry.yarnpkg.com/@openbook-dex/openbook-v2/-/openbook-v2-0.2.10.tgz#a5cfcd30ce827ecd446b76429a5e41baa23a318c"
integrity sha512-JOroVQHeia+RbghpluDJB5psUIhdhYRPLu0zWoG0h5vgDU4SjXwlcC+LJiIa2HVPasvZjWuCtlKWFyrOS75lOA==
dependencies:
"@coral-xyz/anchor" "^0.29.0"
"@solana/spl-token" "^0.4.0"
"@solana/web3.js" "^1.77.3"
big.js "^6.2.1"
"@opentelemetry/api-metrics@0.29.2":
version "0.29.2"
resolved "https://registry.yarnpkg.com/@opentelemetry/api-metrics/-/api-metrics-0.29.2.tgz#daa823e0965754222b49a6ae6133df8b39ff8fd2"
integrity sha512-yRdF5beqKuEdsPNoO7ijWCQ9HcyN0Tlgicf8RS6gzGOI54d6Hj7yKquJ6+X9XV+CSRbRWJYb+lOsXyso7uyX2g==
dependencies:
"@opentelemetry/api" "^1.0.0"
"@opentelemetry/api-metrics@0.31.0":
version "0.31.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/api-metrics/-/api-metrics-0.31.0.tgz#0ed4cf4d7c731f968721c2b303eaf5e9fd42f736"
integrity sha512-PcL1x0kZtMie7NsNy67OyMvzLEXqf3xd0TZJKHHPMGTe89oMpNVrD1zJB1kZcwXOxLlHHb6tz21G3vvXPdXyZg==
dependencies:
"@opentelemetry/api" "^1.0.0"
"@opentelemetry/api@1.7.0", "@opentelemetry/api@^1.0.0":
version "1.7.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.7.0.tgz#b139c81999c23e3c8d3c0a7234480e945920fc40"
integrity sha512-AdY5wvN0P2vXBi3b29hxZgSFvdhdxPB9+f0B6s//P9Q8nibRWeA3cHm8UmLpio9ABigkVHJ5NMPk+Mz8VCCyrw==
"@opentelemetry/auto-instrumentations-node@0.31.2":
version "0.31.2"
resolved "https://registry.yarnpkg.com/@opentelemetry/auto-instrumentations-node/-/auto-instrumentations-node-0.31.2.tgz#56984f2c2def73fced692c36431b9010a97f475f"
integrity sha512-6aIDfnBtQessKT3BeSMdK4qUEhlfvyOCOVIgAZshaHYWqsMCxDo080P7LKu6KBe8JqZAMjhjECv7vjA4YCU/mQ==
dependencies:
"@opentelemetry/instrumentation" "^0.29.2"
"@opentelemetry/instrumentation-amqplib" "^0.30.0"
"@opentelemetry/instrumentation-aws-lambda" "^0.32.0"
"@opentelemetry/instrumentation-aws-sdk" "^0.8.1"
"@opentelemetry/instrumentation-bunyan" "^0.29.0"
"@opentelemetry/instrumentation-cassandra-driver" "^0.29.1"
"@opentelemetry/instrumentation-connect" "^0.29.0"
"@opentelemetry/instrumentation-dns" "^0.29.0"
"@opentelemetry/instrumentation-express" "^0.30.0"
"@opentelemetry/instrumentation-fastify" "^0.28.0"
"@opentelemetry/instrumentation-generic-pool" "^0.29.0"
"@opentelemetry/instrumentation-graphql" "^0.29.0"
"@opentelemetry/instrumentation-grpc" "^0.29.2"
"@opentelemetry/instrumentation-hapi" "^0.29.0"
"@opentelemetry/instrumentation-http" "^0.29.2"
"@opentelemetry/instrumentation-ioredis" "^0.31.0"
"@opentelemetry/instrumentation-knex" "^0.29.1"
"@opentelemetry/instrumentation-koa" "^0.31.0"
"@opentelemetry/instrumentation-lru-memoizer" "^0.30.0"
"@opentelemetry/instrumentation-memcached" "^0.29.0"
"@opentelemetry/instrumentation-mongodb" "^0.31.1"
"@opentelemetry/instrumentation-mysql" "^0.30.0"
"@opentelemetry/instrumentation-mysql2" "^0.31.1"
"@opentelemetry/instrumentation-nestjs-core" "^0.30.0"
"@opentelemetry/instrumentation-net" "^0.29.0"
"@opentelemetry/instrumentation-pg" "^0.30.0"
"@opentelemetry/instrumentation-pino" "^0.30.0"
"@opentelemetry/instrumentation-redis" "^0.32.0"
"@opentelemetry/instrumentation-redis-4" "^0.31.0"
"@opentelemetry/instrumentation-restify" "^0.29.0"
"@opentelemetry/instrumentation-winston" "^0.29.0"
"@opentelemetry/context-async-hooks@1.5.0":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/context-async-hooks/-/context-async-hooks-1.5.0.tgz#4955313e7f0ec0fe17c813328a2a7f39f262c0fa"
integrity sha512-mhBPP0BU0RaH2HB8U4MDd5OjWA1y7SoLOovCT0iEpJAltaq2z04uxRJVzIs91vkpNnV0utUZowQQD3KElgU+VA==
"@opentelemetry/core@1.18.1", "@opentelemetry/core@^1.0.0":
version "1.18.1"
resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-1.18.1.tgz#d2e45f6bd6be4f00d20d18d4f1b230ec33805ae9"
integrity sha512-kvnUqezHMhsQvdsnhnqTNfAJs3ox/isB0SVrM1dhVFw7SsB7TstuVa6fgWnN2GdPyilIFLUvvbTZoVRmx6eiRg==
dependencies:
"@opentelemetry/semantic-conventions" "1.18.1"
"@opentelemetry/core@1.3.1":
version "1.3.1"
resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-1.3.1.tgz#6eef5c5efca9a4cd7daa0cd4c7ff28ca2317c8d7"
integrity sha512-k7lOC86N7WIyUZsUuSKZfFIrUtINtlauMGQsC1r7jNmcr0vVJGqK1ROBvt7WWMxLbpMnt1q2pXJO8tKu0b9auA==
dependencies:
"@opentelemetry/semantic-conventions" "1.3.1"
"@opentelemetry/core@1.5.0":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-1.5.0.tgz#717bceee15d4c69d4c7321c1fe0f5a562b60eb81"
integrity sha512-B3DIMkQN0DANrr7XrMLS4pR6d2o/jqT09x4nZJz6wSJ9SHr4eQIqeFBNeEUQG1I+AuOcH2UbJtgFm7fKxLqd+w==
dependencies:
"@opentelemetry/semantic-conventions" "1.5.0"
"@opentelemetry/exporter-prometheus@0.31.0":
version "0.31.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/exporter-prometheus/-/exporter-prometheus-0.31.0.tgz#b0696be42542a961ec1145f3754a845efbda942e"
integrity sha512-EfWFzoCu/THw0kZiaA2RUrk6XIQbfaJHJ26LRrVIK7INwosW8Q+x4pGfiJ5nxhglYiG9OTqGrQ6nQ4T9q1UMpg==
dependencies:
"@opentelemetry/api-metrics" "0.31.0"
"@opentelemetry/core" "1.5.0"
"@opentelemetry/sdk-metrics-base" "0.31.0"
"@opentelemetry/instrumentation-amqplib@^0.30.0":
version "0.30.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-amqplib/-/instrumentation-amqplib-0.30.0.tgz#03d6835baa65ad5f124e5418a59cefd6ee0916a6"
integrity sha512-aZZgi/O/kwrCIGSkf/7Sy7dB4ZzRTLcnU7A62SZWWU7f6C4KUXQ1TMizwJphF4P8QheqlgqJfoWrw+KDLheJbw==
dependencies:
"@opentelemetry/core" "^1.0.0"
"@opentelemetry/instrumentation" "^0.29.2"
"@opentelemetry/semantic-conventions" "^1.0.0"
"@types/amqplib" "^0.5.17"
"@opentelemetry/instrumentation-aws-lambda@^0.32.0":
version "0.32.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-aws-lambda/-/instrumentation-aws-lambda-0.32.0.tgz#bff00b9957a235671dbe42645f84e27043af95bb"
integrity sha512-mVgd03G292DSkix5ARkTdp/dkPEhLwgwNDhEHsR1isOW2Lw3WKr4dCjMQKAYmbhhj3jg1/ovlwkhEQz6hIqXYQ==
dependencies:
"@opentelemetry/instrumentation" "^0.29.2"
"@opentelemetry/propagator-aws-xray" "^1.1.0"
"@opentelemetry/resources" "^1.0.0"
"@opentelemetry/semantic-conventions" "^1.0.0"
"@types/aws-lambda" "8.10.81"
"@opentelemetry/instrumentation-aws-sdk@^0.8.1":
version "0.8.1"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-aws-sdk/-/instrumentation-aws-sdk-0.8.1.tgz#c0ffaeffb79a189ace52792c14a8e6857a36b187"
integrity sha512-2xZTDopynPHPp5isa+Pdl/uiAQB5/cKNOUhYdNu7rxMwrs58/JZ6WQk7T+n/d0fwuzpgCzpIDH0NkI05nuxYoQ==
dependencies:
"@opentelemetry/core" "^1.0.0"
"@opentelemetry/instrumentation" "^0.29.2"
"@opentelemetry/propagation-utils" "^0.28.0"
"@opentelemetry/semantic-conventions" "^1.0.0"
"@opentelemetry/instrumentation-bunyan@^0.29.0":
version "0.29.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-bunyan/-/instrumentation-bunyan-0.29.0.tgz#04132ef917e39200d76331e32b36a968bafbfbd3"
integrity sha512-i1FZ+W96vQCIpkMKPZW0HOA79ve9PLIcTAFH0adU/CvtRRMSxyKPTKzWMGHcWr6DueKIPEorpMG+nO2Z/yk9iQ==
dependencies:
"@opentelemetry/instrumentation" "^0.29.2"
"@types/bunyan" "1.8.7"
"@opentelemetry/instrumentation-cassandra-driver@^0.29.1":
version "0.29.1"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-cassandra-driver/-/instrumentation-cassandra-driver-0.29.1.tgz#b19c047272b20086aa72287907e911687f18c4ad"
integrity sha512-kaJqgH1IHfZk96n4zmcZESyr2JQx6l5ItzvQPrQ3mI5rD29pE6LbRKP1vU1d5+Ki/H2M1tdf29Os7MxlTgA4UA==
dependencies:
"@opentelemetry/instrumentation" "^0.29.2"
"@opentelemetry/semantic-conventions" "^1.0.0"
"@opentelemetry/instrumentation-connect@^0.29.0":
version "0.29.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-connect/-/instrumentation-connect-0.29.0.tgz#d9fdd7ab0ec030b2760af6a7baaf3bd854e54fdd"
integrity sha512-2BvdIdUCPIYNnROaMToLG76wZXvZXM2L9zOtEFlUnp8teI3Lu2mSPKRaSZ6XAmVVgTAtpfq2IuJMcZ5zAhJuCg==
dependencies:
"@opentelemetry/core" "^1.0.0"
"@opentelemetry/instrumentation" "^0.29.2"
"@opentelemetry/semantic-conventions" "^1.0.0"
"@types/connect" "3.4.35"
"@opentelemetry/instrumentation-dns@^0.29.0":
version "0.29.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-dns/-/instrumentation-dns-0.29.0.tgz#efd21eb9d8938de97e225b52f8a432d6072b4096"
integrity sha512-3WTC4m6JKviaABiR3a+56WUMvrUp9WW9EYC0+LRpqm7RK/1a5bYq2Cozc2SlFYX9ZfWKMqGS39/fU24mKQ5toA==
dependencies:
"@opentelemetry/instrumentation" "^0.29.2"
"@opentelemetry/semantic-conventions" "^1.0.0"
semver "^7.3.2"
"@opentelemetry/instrumentation-express@^0.30.0":
version "0.30.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-express/-/instrumentation-express-0.30.0.tgz#4f5f45ce47c8f1ac75741284d3e59c861ced4269"
integrity sha512-OsCfM+ThAXh3wzsyHgXyA5HUoLMdLd6Asix2Jx8yxniruU/Gq8y4Cz7aLy/vXNckXHWO3fwwL5gb7K3dykTnAQ==
dependencies:
"@opentelemetry/core" "^1.0.0"
"@opentelemetry/instrumentation" "^0.29.2"
"@opentelemetry/semantic-conventions" "^1.0.0"
"@types/express" "4.17.13"
"@opentelemetry/instrumentation-fastify@^0.28.0":
version "0.28.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-fastify/-/instrumentation-fastify-0.28.0.tgz#83364768fb040d89a62f3a0e2d560228499520b3"
integrity sha512-HVvxTDgAhGZqp5k/JA/W4cMpHMy25CXy1pJDOoVB08gC6TKDBg/54iKgLr+g+nqV9RejIKfydt+35Xesynay/g==
dependencies:
"@opentelemetry/core" "^1.0.0"
"@opentelemetry/instrumentation" "^0.29.2"
"@opentelemetry/semantic-conventions" "^1.0.0"
fastify "^3.19.2"
"@opentelemetry/instrumentation-generic-pool@^0.29.0":
version "0.29.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-generic-pool/-/instrumentation-generic-pool-0.29.0.tgz#cf566d37927d383ab6692956f0359ea99db018ca"
integrity sha512-tCVIVdGLS4bsFOwYGcbzuESh3XREfdhtMU9iXkULON1KoYi1c68HlWC9yyNQL7yTCBkbYSk2XjWKs6dHbcSf3A==
dependencies:
"@opentelemetry/instrumentation" "^0.29.2"
"@opentelemetry/semantic-conventions" "^1.0.0"
"@types/generic-pool" "^3.1.9"
"@opentelemetry/instrumentation-graphql@^0.29.0":
version "0.29.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-graphql/-/instrumentation-graphql-0.29.0.tgz#98abeb3722120656df82e8dbd90dd0b76d9b33ea"
integrity sha512-mAjz326UtWGQUAmmEY6VB4XV1kbgQGBmRWjh/QT0giLwcbKa9RdO0x0B+VbALbrth7ZtHuoyKaDjCWowuzUujw==
dependencies:
"@opentelemetry/instrumentation" "^0.29.2"
graphql "^15.5.1"
"@opentelemetry/instrumentation-grpc@^0.29.2":
version "0.29.2"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-grpc/-/instrumentation-grpc-0.29.2.tgz#a98431f248431d2d5ecc39da3e72f14620a4b3b9"
integrity sha512-rWyx/a7CsEYopwxaND47z+I8SrTLTHEz9sm8sf30FkMviVyRzYqt2PJT+JMGInM7Om/IpZNEc29kSzUjLmqddQ==
dependencies:
"@opentelemetry/api-metrics" "0.29.2"
"@opentelemetry/instrumentation" "0.29.2"
"@opentelemetry/semantic-conventions" "1.3.1"
"@opentelemetry/instrumentation-hapi@^0.29.0":
version "0.29.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-hapi/-/instrumentation-hapi-0.29.0.tgz#2eea553df1308b3df409d5f62ba4db71b07d955b"
integrity sha512-yqfuKALO20Mx6F8GStnwTmD/JUhR9JGV3GJVH3UJ5TDAvz61hhoQWaBm0iAP5cJhrKRMD8mictAT2OiHSPUpLw==
dependencies:
"@opentelemetry/core" "^1.0.0"
"@opentelemetry/instrumentation" "^0.29.2"
"@opentelemetry/semantic-conventions" "^1.0.0"
"@types/hapi__hapi" "20.0.9"
"@opentelemetry/instrumentation-http@^0.29.2":
version "0.29.2"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-http/-/instrumentation-http-0.29.2.tgz#c4750c33929d476c2a656f457c83d2144c5dd844"
integrity sha512-XIF9WCH03rp3vQjwXXVdTxlsXT2AG6LYfFKO8r2QC+w4F4KFuZa4J3VPYJ0L/a/6dWt34DA67eBh3l6Z1rMZrg==
dependencies:
"@opentelemetry/core" "1.3.1"
"@opentelemetry/instrumentation" "0.29.2"
"@opentelemetry/semantic-conventions" "1.3.1"
semver "^7.3.5"
"@opentelemetry/instrumentation-ioredis@^0.31.0":
version "0.31.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-ioredis/-/instrumentation-ioredis-0.31.0.tgz#1f11278508da9ec5ff5b2012c2057218a9c98ef1"
integrity sha512-wP9KbFxdcrI1uQ5QATOfzhEUhb6gM+HY0rwgnch0Q/IpItstowUiQ+IwaOSTQVmPoh7frdSbIXAmFBO6mJyBVQ==
dependencies:
"@opentelemetry/instrumentation" "^0.29.2"
"@opentelemetry/semantic-conventions" "^1.0.0"
"@types/ioredis" "4.26.6"
"@opentelemetry/instrumentation-knex@^0.29.1":
version "0.29.1"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-knex/-/instrumentation-knex-0.29.1.tgz#bdcc18a14dbc3e3ce414a87980a8086c251c01d9"
integrity sha512-QPj8TSIpqlRJV2b6G6vBJBnOMVbazxwSX3NSfs5OK320hHh5tzvTqYuLRdkQPKZCPOxo0mdBJv8kj45Ywrljfg==
dependencies:
"@opentelemetry/instrumentation" "^0.29.2"
"@opentelemetry/semantic-conventions" "^1.0.0"
"@opentelemetry/instrumentation-koa@^0.31.0":
version "0.31.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-koa/-/instrumentation-koa-0.31.0.tgz#f5ba701076e217aaf791a0f9bd62fa56e660c6d7"
integrity sha512-0qqc/wcqqj+wQZLGsJhQ1LeG38AXF+yeK9YRIfdYiqjhe9UzqcYPCGxNWQzw9PTyNQXCAp6vBzt7AaGitTyEOg==
dependencies:
"@opentelemetry/core" "^1.0.0"
"@opentelemetry/instrumentation" "^0.29.2"
"@opentelemetry/semantic-conventions" "^1.0.0"
"@types/koa" "2.13.4"
"@types/koa__router" "8.0.7"
"@opentelemetry/instrumentation-lru-memoizer@^0.30.0":
version "0.30.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-lru-memoizer/-/instrumentation-lru-memoizer-0.30.0.tgz#0f14ad282e482b747a3c57dffea854f006bce4f9"
integrity sha512-9jcqaVsF+jkIYdDFQB5kAyYn4DjG/8SOg4p94zYCj4pHlHDawIVH0UkUFh2h6xRkGhhpsWUcsTHPG4KFxX+vUQ==
dependencies:
"@opentelemetry/instrumentation" "^0.29.2"
"@opentelemetry/instrumentation-memcached@^0.29.0":
version "0.29.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-memcached/-/instrumentation-memcached-0.29.0.tgz#6f76151044e9ad25ff8545b9b472a0d8593be1f1"
integrity sha512-th+zERg1/1DpCVZ3doKPmjVnbPFBZO5RHcteFkt28ibYTrPEL6K4EciTybdIyC10madFOJRydC9lfvDfgY857g==
dependencies:
"@opentelemetry/instrumentation" "^0.29.2"
"@opentelemetry/semantic-conventions" "^1.0.0"
"@types/memcached" "^2.2.6"
"@opentelemetry/instrumentation-mongodb@^0.31.1":
version "0.31.1"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-mongodb/-/instrumentation-mongodb-0.31.1.tgz#abffcc2095f4e2d25f1c71aaef8dc9b7e56ee045"
integrity sha512-g3vvq1WomdsAfXzfXjUCnkBOUeextG5bPCGBI9IssGVLCk6qqw85IPhUZiemNXZBECp85I6RVBO7NqAw9IQBnQ==
dependencies:
"@opentelemetry/instrumentation" "^0.29.2"
"@opentelemetry/semantic-conventions" "^1.0.0"
"@types/mongodb" "3.6.20"
"@opentelemetry/instrumentation-mysql2@^0.31.1":
version "0.31.1"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-mysql2/-/instrumentation-mysql2-0.31.1.tgz#10925395acddc66b66cc523b11ec7b31edd970b3"
integrity sha512-IHRSaXB4sUm96H7u+fcWpuYZ8639XuaSREoG56fjsfbn7V9Y8fASizTudCRWbIQwBdenog7ncM+KkJWk2yqJyg==
dependencies:
"@opentelemetry/instrumentation" "^0.29.2"
"@opentelemetry/semantic-conventions" "^1.0.0"
"@opentelemetry/instrumentation-mysql@^0.30.0":
version "0.30.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-mysql/-/instrumentation-mysql-0.30.0.tgz#c89bb5861cedc2a7ba7e4d6b58dd934f96d73945"
integrity sha512-FdbZ2Yb15OTGa6HZYXxUL0yhcXNec2HHbUp9nn3x2B9YO9bJHJQoNVyHVd5gssMVYKFg4dgZodY/YXYu9xj2Ow==
dependencies:
"@opentelemetry/instrumentation" "^0.29.2"
"@opentelemetry/semantic-conventions" "^1.0.0"
"@types/mysql" "2.15.19"
"@opentelemetry/instrumentation-nestjs-core@^0.30.0":
version "0.30.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-nestjs-core/-/instrumentation-nestjs-core-0.30.0.tgz#bd8bd45c3fec64c2071967f21f4598163d05812d"
integrity sha512-z9HSjL4Udx2tteqyjvzrmNk6mxhip4BkWSWWZKN0z7t+waIHKfTTgJiTn5/YxwGYLUIKVigmNlAoo987rmK+xA==
dependencies:
"@opentelemetry/instrumentation" "^0.29.2"
"@opentelemetry/semantic-conventions" "^1.0.0"
"@opentelemetry/instrumentation-net@^0.29.0":
version "0.29.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-net/-/instrumentation-net-0.29.0.tgz#57b5242c602dfc78cda94829d4016d1c0247ea6f"
integrity sha512-93acTBKvrzyTbQ5g+VItpCqxMn0lcLb8re7wOh7v+hnMAaKc431fcPuVbOcsNHdMZ7LF1qnOZfs0sooT/chIDA==
dependencies:
"@opentelemetry/instrumentation" "^0.29.2"
"@opentelemetry/semantic-conventions" "^1.0.0"
"@opentelemetry/instrumentation-pg@^0.30.0":
version "0.30.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-pg/-/instrumentation-pg-0.30.0.tgz#5941dd2817a846e7b5bc283112a9cf46728d1f44"
integrity sha512-RQ3cTTJnCBE/9GagjSpaM+yzxN25MvEwOxDFes3y8c1cqrMgqxukQLm3MbcqCQ8e1g/8d18+oyiEeBUjZJ5jnw==
dependencies:
"@opentelemetry/instrumentation" "^0.29.2"
"@opentelemetry/semantic-conventions" "^1.0.0"
"@types/pg" "8.6.1"
"@types/pg-pool" "2.0.3"
"@opentelemetry/instrumentation-pino@^0.30.0":
version "0.30.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-pino/-/instrumentation-pino-0.30.0.tgz#575837aefc581265234af622d315cd35649024e8"
integrity sha512-ZbmRL58f3Qviwai/JunUZb/uKo1NYRLdCrKoss7seJ3mEvuTcgTIVeo93PSqxk2c4LMdvkTcNAcIAv1Ymw/PyQ==
dependencies:
"@opentelemetry/instrumentation" "^0.29.2"
pino "7.10.0"
semver "^7.3.5"
"@opentelemetry/instrumentation-redis-4@^0.31.0":
version "0.31.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-redis-4/-/instrumentation-redis-4-0.31.0.tgz#3db1cfc177857fc208b73565df2d54065c69a67e"
integrity sha512-3DY6bkqKnVlPc2WWHelb6DnU78ryYLQFqv0lqnVsoSkr7b6hnmw1Bzuwo/5YmS4C3XuTAD4/6dZVrQJ23g8HNA==
dependencies:
"@opentelemetry/instrumentation" "^0.29.2"
"@opentelemetry/semantic-conventions" "^1.0.0"
"@opentelemetry/instrumentation-redis@^0.32.0":
version "0.32.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-redis/-/instrumentation-redis-0.32.0.tgz#c361fb8b0eac448927b31b6f42fa5a5c84bfb79d"
integrity sha512-KaZnYhz8dZ9gHkvrBo2U7bp/HABM2JXd3i6e8cUP8MyNA8x5P+EUbeSzzBMe6bAZH35S60dAQbBAhRji3ZlPRw==
dependencies:
"@opentelemetry/instrumentation" "^0.29.2"
"@opentelemetry/semantic-conventions" "^1.0.0"
"@types/redis" "2.8.31"
"@opentelemetry/instrumentation-restify@^0.29.0":
version "0.29.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-restify/-/instrumentation-restify-0.29.0.tgz#67a3a3f6f1f736cee59222cd4a8bd37a2f16f848"
integrity sha512-jjXtzNut03FBernMrEjJnkX9SdUAjpGh04mauR2GhBjSrkQg73gS7jeMS/xyN6/ufphA0tyFygxNPOWFvjXM6g==
dependencies:
"@opentelemetry/core" "^1.0.0"
"@opentelemetry/instrumentation" "^0.29.2"
"@opentelemetry/semantic-conventions" "^1.0.0"
"@types/restify" "4.3.8"
"@opentelemetry/instrumentation-winston@^0.29.0":
version "0.29.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-winston/-/instrumentation-winston-0.29.0.tgz#75d575b95f3e85b784d90b1e5414ec30df5c9196"
integrity sha512-z48oitpODk5BkJXp4OlRLAQf5JLH0jcSmHvqhlgB9tHddNG+xQWa1Xb0kyBX4i4r0jGFR7cvImIb53wrEavUBA==
dependencies:
"@opentelemetry/instrumentation" "^0.29.2"
"@opentelemetry/instrumentation@0.29.2", "@opentelemetry/instrumentation@^0.29.2":
version "0.29.2"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation/-/instrumentation-0.29.2.tgz#70e6d4e1a84508f5e9d8c7c426adcd7b0dba6c95"
integrity sha512-LXx5V0ONNATQFCE8C5uqnxWSm4rcXLssdLHdXjtGdxRmURqj/JO8jYefqXCD0LzsqEQ6yxOx2GZ0dgXvhBVdTw==
dependencies:
"@opentelemetry/api-metrics" "0.29.2"
require-in-the-middle "^5.0.3"
semver "^7.3.2"
shimmer "^1.2.1"
"@opentelemetry/instrumentation@0.31.0":
version "0.31.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation/-/instrumentation-0.31.0.tgz#bee0052a86e22f57be3901c44234f1a210bcfda8"
integrity sha512-b2hFebXPtBcut4d81b8Kg6GiCoAS8nxb8kYSronQYAXxwNSetqHwIJ2nKLo1slFH1UWUXn0zi3eDez2Sn/9uMQ==
dependencies:
"@opentelemetry/api-metrics" "0.31.0"
require-in-the-middle "^5.0.3"
semver "^7.3.2"
shimmer "^1.2.1"
"@opentelemetry/propagation-utils@^0.28.0":
version "0.28.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/propagation-utils/-/propagation-utils-0.28.0.tgz#035e8311db46b712d55c0ef5fee79042f0f9d8e6"
integrity sha512-IsBUTz110RB75Xg6dejSD8JSyiXll81zTu/2dph5VdPMSgMOGQTYhtv0Mv1BydJh4dZpR+Z9WHTiHdkp1IQOCw==
"@opentelemetry/propagator-aws-xray@^1.1.0":
version "1.3.1"
resolved "https://registry.yarnpkg.com/@opentelemetry/propagator-aws-xray/-/propagator-aws-xray-1.3.1.tgz#7fc77a95fe89c705442b0e5a4218422c2954cc07"
integrity sha512-6fDMzFlt5r6VWv7MUd0eOpglXPFqykW8CnOuUxJ1VZyLy6mV1bzBlzpsqEmhx1bjvZYvH93vhGkQZqrm95mlrQ==
dependencies:
"@opentelemetry/core" "^1.0.0"
"@opentelemetry/propagator-b3@1.5.0":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/propagator-b3/-/propagator-b3-1.5.0.tgz#7fc1876f11e0a92fc93185d14e0dae99f42bb135"
integrity sha512-38iGIScgU9OLhoPKAV3p2rEf4RmmQC/Lo4LvpQ6TaSQrRht/oDgnpsPJnmNQLFboklmukKataJO+FhAieOc7mg==
dependencies:
"@opentelemetry/core" "1.5.0"
"@opentelemetry/propagator-jaeger@1.5.0":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/propagator-jaeger/-/propagator-jaeger-1.5.0.tgz#b4ccffc0fa59f94ea67e0884c543d39bbbd1c18d"
integrity sha512-aSUH5RDEZj+lmy4PbXAJ26E+yJcZloyPUBWgqYX+JBS4NnbriIznCF/tXV5s/RUXeVABibi/+yAZndv+2XBg4w==
dependencies:
"@opentelemetry/core" "1.5.0"
"@opentelemetry/resources@1.5.0":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/resources/-/resources-1.5.0.tgz#ce7fbdaec3494e41bc279ddbed3c478ee2570b03"
integrity sha512-YeEfC6IY54U3xL3P2+UAiom+r50ZF2jM0J47RV5uTFGF19Xjd5zazSwDPgmxtAd6DwLX0/5S5iqrsH4nEXMYoA==
dependencies:
"@opentelemetry/core" "1.5.0"
"@opentelemetry/semantic-conventions" "1.5.0"
"@opentelemetry/resources@^1.0.0":
version "1.18.1"
resolved "https://registry.yarnpkg.com/@opentelemetry/resources/-/resources-1.18.1.tgz#e27bdc4715bccc8cd4a72d4aca3995ad0a496fe7"
integrity sha512-JjbcQLYMttXcIabflLRuaw5oof5gToYV9fuXbcsoOeQ0BlbwUn6DAZi++PNsSz2jjPeASfDls10iaO/8BRIPRA==
dependencies:
"@opentelemetry/core" "1.18.1"
"@opentelemetry/semantic-conventions" "1.18.1"
"@opentelemetry/sdk-metrics-base@0.31.0":
version "0.31.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-metrics-base/-/sdk-metrics-base-0.31.0.tgz#f797da702c8d9862a2fff55a1e7c70aa6845e535"
integrity sha512-4R2Bjl3wlqIGcq4bCoI9/pD49ld+tEoM9n85UfFzr/aUe+2huY2jTPq/BP9SVB8d2Zfg7mGTIFeapcEvAdKK7g==
dependencies:
"@opentelemetry/api-metrics" "0.31.0"
"@opentelemetry/core" "1.5.0"
"@opentelemetry/resources" "1.5.0"
lodash.merge "4.6.2"
"@opentelemetry/sdk-node@0.31.0":
version "0.31.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-node/-/sdk-node-0.31.0.tgz#e85fd806477ee27744472a471e629259177a272f"
integrity sha512-BNz5CRNbacQMz47XPwrerTBkxPjo8eZTtpkBR2a099Yyc/F3ArTWbGB/rbEgb0VNVydp+WtSikqj+9gZ25KQJQ==
dependencies:
"@opentelemetry/api-metrics" "0.31.0"
"@opentelemetry/core" "1.5.0"
"@opentelemetry/instrumentation" "0.31.0"
"@opentelemetry/resources" "1.5.0"
"@opentelemetry/sdk-metrics-base" "0.31.0"
"@opentelemetry/sdk-trace-base" "1.5.0"
"@opentelemetry/sdk-trace-node" "1.5.0"
"@opentelemetry/sdk-trace-base@1.5.0":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.5.0.tgz#259439009fff5637e7a379ece7446ce5beb84b77"
integrity sha512-6lx7YDf67HSQYuWnvq3XgSrWikDJLiGCbrpUP6UWJ5Z47HLcJvwZPRH+cQGJu1DFS3dT2cV3GpAR75/OofPNHQ==
dependencies:
"@opentelemetry/core" "1.5.0"
"@opentelemetry/resources" "1.5.0"
"@opentelemetry/semantic-conventions" "1.5.0"
"@opentelemetry/sdk-trace-node@1.5.0":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-node/-/sdk-trace-node-1.5.0.tgz#8a6af64b8e6fb970b998844f99349e654327a60d"
integrity sha512-MzS+urf2KufpwgaHbGcUgccHr6paxI98lHFMgJAkK6w76AmPYavsxSwjiVPrchy/24d2J9svDirSgui3NNZo8g==
dependencies:
"@opentelemetry/context-async-hooks" "1.5.0"
"@opentelemetry/core" "1.5.0"
"@opentelemetry/propagator-b3" "1.5.0"
"@opentelemetry/propagator-jaeger" "1.5.0"
"@opentelemetry/sdk-trace-base" "1.5.0"
semver "^7.3.5"
"@opentelemetry/semantic-conventions@1.18.1", "@opentelemetry/semantic-conventions@^1.0.0":
version "1.18.1"
resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.18.1.tgz#8e47caf57a84b1dcc1722b2025693348cdf443b4"
integrity sha512-+NLGHr6VZwcgE/2lw8zDIufOCGnzsA5CbQIMleXZTrgkBd0TanCX+MiDYJ1TOS4KL/Tqk0nFRxawnaYr6pkZkA==
"@opentelemetry/semantic-conventions@1.3.1":
version "1.3.1"
resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.3.1.tgz#ba07b864a3c955f061aa30ea3ef7f4ae4449794a"
integrity sha512-wU5J8rUoo32oSef/rFpOT1HIjLjAv3qIDHkw1QIhODV3OpAVHi5oVzlouozg9obUmZKtbZ0qUe/m7FP0y0yBzA==
"@opentelemetry/semantic-conventions@1.5.0":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.5.0.tgz#cea9792bfcf556c87ded17c6ac729348697bb632"
integrity sha512-wlYG/U6ddW1ilXslnDLLQYJ8nd97W8JJTTfwkGhubx6dzW6SUkd+N4/MzTjjyZlrHQunxHtkHFvVpUKiROvFDw==
"@project-serum/anchor@0.19.1-beta.1":
version "0.19.1-beta.1"
resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.19.1-beta.1.tgz#516b78432acabd8563831c3b9df4628ca34dba28"
integrity sha512-TzkgS5a4WUDJotmur9/pQhqeqa5W14h++ppF+oGZVoR0EkcLbW7SKpx/z80XhsHCIhWz9/1hBAkbKElXdKUUiw==
dependencies:
"@project-serum/borsh" "^0.2.2"
"@solana/web3.js" "^1.17.0"
base64-js "^1.5.1"
bn.js "^5.1.2"
bs58 "^4.0.1"
buffer-layout "^1.2.2"
camelcase "^5.3.1"
crypto-hash "^1.3.0"
eventemitter3 "^4.0.7"
find "^0.3.0"
js-sha256 "^0.9.0"
pako "^2.0.3"
snake-case "^3.0.4"
toml "^3.0.0"
"@project-serum/anchor@^0.11.1":
version "0.11.1"
resolved "https://registry.yarnpkg.com/@project-serum/anchor/-/anchor-0.11.1.tgz#155bff2c70652eafdcfd5559c81a83bb19cec9ff"
integrity sha512-oIdm4vTJkUy6GmE6JgqDAuQPKI7XM4TPJkjtoIzp69RZe0iAD9JP2XHx7lV1jLdYXeYHqDXfBt3zcq7W91K6PA==
dependencies:
"@project-serum/borsh" "^0.2.2"
"@solana/web3.js" "^1.17.0"
base64-js "^1.5.1"
bn.js "^5.1.2"
bs58 "^4.0.1"
buffer-layout "^1.2.0"
camelcase "^5.3.1"
crypto-hash "^1.3.0"
eventemitter3 "^4.0.7"
find "^0.3.0"
js-sha256 "^0.9.0"
pako "^2.0.3"
snake-case "^3.0.4"
toml "^3.0.0"
"@project-serum/borsh@^0.2.2":
version "0.2.5"
resolved "https://registry.yarnpkg.com/@project-serum/borsh/-/borsh-0.2.5.tgz#6059287aa624ecebbfc0edd35e4c28ff987d8663"
integrity sha512-UmeUkUoKdQ7rhx6Leve1SssMR/Ghv8qrEiyywyxSWg7ooV7StdpPBhciiy5eB3T0qU1BXvdRNC8TdrkxK7WC5Q==
dependencies:
bn.js "^5.1.2"
buffer-layout "^1.2.0"
"@project-serum/serum@0.13.65":
version "0.13.65"
resolved "https://registry.yarnpkg.com/@project-serum/serum/-/serum-0.13.65.tgz#6d3cf07912f13985765237f053cca716fe84b0b0"
integrity sha512-BHRqsTqPSfFB5p+MgI2pjvMBAQtO8ibTK2fYY96boIFkCI3TTwXDt2gUmspeChKO2pqHr5aKevmexzAcXxrSRA==
dependencies:
"@project-serum/anchor" "^0.11.1"
"@solana/spl-token" "^0.1.6"
"@solana/web3.js" "^1.21.0"
bn.js "^5.1.2"
buffer-layout "^1.2.0"
"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf"
integrity sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==
"@protobufjs/base64@^1.1.2":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735"
integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==
"@protobufjs/codegen@^2.0.4":
version "2.0.4"
resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb"
integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==
"@protobufjs/eventemitter@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70"
integrity sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==
"@protobufjs/fetch@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45"
integrity sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==
dependencies:
"@protobufjs/aspromise" "^1.1.1"
"@protobufjs/inquire" "^1.1.0"
"@protobufjs/float@^1.0.2":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1"
integrity sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==
"@protobufjs/inquire@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089"
integrity sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==
"@protobufjs/path@^1.1.2":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d"
integrity sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==
"@protobufjs/pool@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54"
integrity sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==
"@protobufjs/utf8@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570"
integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==
"@pythnetwork/client@2.5.3":
version "2.5.3"
resolved "https://registry.yarnpkg.com/@pythnetwork/client/-/client-2.5.3.tgz#86c9f92d01d8f282fdd8b5b11039da654e263988"
integrity sha512-NBLxPnA6A3tZb/DYUooD4SO63UJ70s9DzzFPGXcQNBR9itcycp7aaV+UA5oUPloD/4UHL9soo2fRuDVur0gmhA==
dependencies:
"@solana/web3.js" "^1.30.2"
assert "^2.0.0"
buffer "^6.0.1"
"@pythnetwork/price-service-client@1.9.0":
version "1.9.0"
resolved "https://registry.yarnpkg.com/@pythnetwork/price-service-client/-/price-service-client-1.9.0.tgz#1503d67b1a7c14386d30bb420502df4857027e76"
integrity sha512-SLm3IFcfmy9iMqHeT4Ih6qMNZhJEefY14T9yTlpsH2D/FE5+BaGGnfcexUifVlfH6M7mwRC4hEFdNvZ6ebZjJg==
dependencies:
"@pythnetwork/price-service-sdk" "*"
"@types/ws" "^8.5.3"
axios "^1.5.1"
axios-retry "^3.8.0"
isomorphic-ws "^4.0.1"
ts-log "^2.2.4"
ws "^8.6.0"
"@pythnetwork/price-service-sdk@*", "@pythnetwork/price-service-sdk@1.7.1", "@pythnetwork/price-service-sdk@>=1.6.0":
version "1.7.1"
resolved "https://registry.yarnpkg.com/@pythnetwork/price-service-sdk/-/price-service-sdk-1.7.1.tgz#dbfc8a8c2189f526346c1f79ec3995e89b690700"
integrity sha512-xr2boVXTyv1KUt/c6llUTfbv2jpud99pWlMJbFaHGUBoygQsByuy7WbjIJKZ+0Blg1itLZl0Lp/pJGGg8SdJoQ==
dependencies:
bn.js "^5.2.1"
"@pythnetwork/pyth-solana-receiver@0.7.0":
version "0.7.0"
resolved "https://registry.yarnpkg.com/@pythnetwork/pyth-solana-receiver/-/pyth-solana-receiver-0.7.0.tgz#253a0d15a135d625ceca7ba1b47940dd03b9cab6"
integrity sha512-OoEAHh92RPRdKkfjkcKGrjC+t0F3SEL754iKFmixN9zyS8pIfZSVfFntmkHa9pWmqEMxdx/i925a8B5ny8Tuvg==
dependencies:
"@coral-xyz/anchor" "^0.29.0"
"@noble/hashes" "^1.4.0"
"@pythnetwork/price-service-sdk" ">=1.6.0"
"@pythnetwork/solana-utils" "*"
"@solana/web3.js" "^1.90.0"
"@pythnetwork/solana-utils@*":
version "0.4.1"
resolved "https://registry.yarnpkg.com/@pythnetwork/solana-utils/-/solana-utils-0.4.1.tgz#8be6792f42bf4e7b4377126107686ed7c06ad8fa"
integrity sha512-xls6Ad1ibG+iByAiXsZjb39AlmYB2cvWnUiiQAjbmNYlQpajmz1bKJ4HhgfylZljE6FGsK4trSCf2YRo3nXBoQ==
dependencies:
"@coral-xyz/anchor" "^0.29.0"
"@solana/web3.js" "^1.90.0"
bs58 "^5.0.0"
jito-ts "^3.0.1"
"@sideway/address@^4.1.3":
version "4.1.4"
resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.4.tgz#03dccebc6ea47fdc226f7d3d1ad512955d4783f0"
integrity sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==
dependencies:
"@hapi/hoek" "^9.0.0"
"@sideway/formula@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@sideway/formula/-/formula-3.0.1.tgz#80fcbcbaf7ce031e0ef2dd29b1bfc7c3f583611f"
integrity sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==
"@sideway/pinpoint@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@sideway/pinpoint/-/pinpoint-2.0.0.tgz#cff8ffadc372ad29fd3f78277aeb29e632cc70df"
integrity sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==
"@solana/buffer-layout-utils@^0.2.0":
version "0.2.0"
resolved "https://registry.yarnpkg.com/@solana/buffer-layout-utils/-/buffer-layout-utils-0.2.0.tgz#b45a6cab3293a2eb7597cceb474f229889d875ca"
integrity sha512-szG4sxgJGktbuZYDg2FfNmkMi0DYQoVjN2h7ta1W1hPrwzarcFLBq9UpX1UjNXsNpT9dn+chgprtWGioUAr4/g==
dependencies:
"@solana/buffer-layout" "^4.0.0"
"@solana/web3.js" "^1.32.0"
bigint-buffer "^1.1.5"
bignumber.js "^9.0.1"
"@solana/buffer-layout@^4.0.0", "@solana/buffer-layout@^4.0.1":
version "4.0.1"
resolved "https://registry.yarnpkg.com/@solana/buffer-layout/-/buffer-layout-4.0.1.tgz#b996235eaec15b1e0b5092a8ed6028df77fa6c15"
integrity sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA==
dependencies:
buffer "~6.0.3"
"@solana/codecs-core@2.0.0-experimental.8618508":
version "2.0.0-experimental.8618508"
resolved "https://registry.yarnpkg.com/@solana/codecs-core/-/codecs-core-2.0.0-experimental.8618508.tgz#4f6709dd50e671267f3bea7d09209bc6471b7ad0"
integrity sha512-JCz7mKjVKtfZxkuDtwMAUgA7YvJcA2BwpZaA1NOLcted4OMC4Prwa3DUe3f3181ixPYaRyptbF0Ikq2MbDkYEA==
"@solana/codecs-core@2.0.0-preview.2":
version "2.0.0-preview.2"
resolved "https://registry.yarnpkg.com/@solana/codecs-core/-/codecs-core-2.0.0-preview.2.tgz#689784d032fbc1fedbde40bb25d76cdcecf6553b"
integrity sha512-gLhCJXieSCrAU7acUJjbXl+IbGnqovvxQLlimztPoGgfLQ1wFYu+XJswrEVQqknZYK1pgxpxH3rZ+OKFs0ndQg==
dependencies:
"@solana/errors" "2.0.0-preview.2"
"@solana/codecs-core@2.0.0-preview.4":
version "2.0.0-preview.4"
resolved "https://registry.yarnpkg.com/@solana/codecs-core/-/codecs-core-2.0.0-preview.4.tgz#770826105f2f884110a21662573e7a2014654324"
integrity sha512-A0VVuDDA5kNKZUinOqHxJQK32aKTucaVbvn31YenGzHX1gPqq+SOnFwgaEY6pq4XEopSmaK16w938ZQS8IvCnw==
dependencies:
"@solana/errors" "2.0.0-preview.4"
"@solana/codecs-data-structures@2.0.0-experimental.8618508":
version "2.0.0-experimental.8618508"
resolved "https://registry.yarnpkg.com/@solana/codecs-data-structures/-/codecs-data-structures-2.0.0-experimental.8618508.tgz#c16a704ac0f743a2e0bf73ada42d830b3402d848"
integrity sha512-sLpjL9sqzaDdkloBPV61Rht1tgaKq98BCtIKRuyscIrmVPu3wu0Bavk2n/QekmUzaTsj7K1pVSniM0YqCdnEBw==
dependencies:
"@solana/codecs-core" "2.0.0-experimental.8618508"
"@solana/codecs-numbers" "2.0.0-experimental.8618508"
"@solana/codecs-data-structures@2.0.0-preview.2":
version "2.0.0-preview.2"
resolved "https://registry.yarnpkg.com/@solana/codecs-data-structures/-/codecs-data-structures-2.0.0-preview.2.tgz#e82cb1b6d154fa636cd5c8953ff3f32959cc0370"
integrity sha512-Xf5vIfromOZo94Q8HbR04TbgTwzigqrKII0GjYr21K7rb3nba4hUW2ir8kguY7HWFBcjHGlU5x3MevKBOLp3Zg==
dependencies:
"@solana/codecs-core" "2.0.0-preview.2"
"@solana/codecs-numbers" "2.0.0-preview.2"
"@solana/errors" "2.0.0-preview.2"
"@solana/codecs-data-structures@2.0.0-preview.4":
version "2.0.0-preview.4"
resolved "https://registry.yarnpkg.com/@solana/codecs-data-structures/-/codecs-data-structures-2.0.0-preview.4.tgz#f8a2470982a9792334737ea64000ccbdff287247"
integrity sha512-nt2k2eTeyzlI/ccutPcG36M/J8NAYfxBPI9h/nQjgJ+M+IgOKi31JV8StDDlG/1XvY0zyqugV3I0r3KAbZRJpA==
dependencies:
"@solana/codecs-core" "2.0.0-preview.4"
"@solana/codecs-numbers" "2.0.0-preview.4"
"@solana/errors" "2.0.0-preview.4"
"@solana/codecs-numbers@2.0.0-experimental.8618508":
version "2.0.0-experimental.8618508"
resolved "https://registry.yarnpkg.com/@solana/codecs-numbers/-/codecs-numbers-2.0.0-experimental.8618508.tgz#d84f9ed0521b22e19125eefc7d51e217fcaeb3e4"
integrity sha512-EXQKfzFr3CkKKNzKSZPOOOzchXsFe90TVONWsSnVkonO9z+nGKALE0/L9uBmIFGgdzhhU9QQVFvxBMclIDJo2Q==
dependencies:
"@solana/codecs-core" "2.0.0-experimental.8618508"
"@solana/codecs-numbers@2.0.0-preview.2":
version "2.0.0-preview.2"
resolved "https://registry.yarnpkg.com/@solana/codecs-numbers/-/codecs-numbers-2.0.0-preview.2.tgz#56995c27396cd8ee3bae8bd055363891b630bbd0"
integrity sha512-aLZnDTf43z4qOnpTcDsUVy1Ci9im1Md8thWipSWbE+WM9ojZAx528oAql+Cv8M8N+6ALKwgVRhPZkto6E59ARw==
dependencies:
"@solana/codecs-core" "2.0.0-preview.2"
"@solana/errors" "2.0.0-preview.2"
"@solana/codecs-numbers@2.0.0-preview.4":
version "2.0.0-preview.4"
resolved "https://registry.yarnpkg.com/@solana/codecs-numbers/-/codecs-numbers-2.0.0-preview.4.tgz#6a53b456bb7866f252d8c032c81a92651e150f66"
integrity sha512-Q061rLtMadsO7uxpguT+Z7G4UHnjQ6moVIxAQxR58nLxDPCC7MB1Pk106/Z7NDhDLHTcd18uO6DZ7ajHZEn2XQ==
dependencies:
"@solana/codecs-core" "2.0.0-preview.4"
"@solana/errors" "2.0.0-preview.4"
"@solana/codecs-strings@2.0.0-experimental.8618508":
version "2.0.0-experimental.8618508"
resolved "https://registry.yarnpkg.com/@solana/codecs-strings/-/codecs-strings-2.0.0-experimental.8618508.tgz#72457b884d9be80b59b263bcce73892b081e9402"
integrity sha512-b2yhinr1+oe+JDmnnsV0641KQqqDG8AQ16Z/x7GVWO+AWHMpRlHWVXOq8U1yhPMA4VXxl7i+D+C6ql0VGFp0GA==
dependencies:
"@solana/codecs-core" "2.0.0-experimental.8618508"
"@solana/codecs-numbers" "2.0.0-experimental.8618508"
"@solana/codecs-strings@2.0.0-preview.2":
version "2.0.0-preview.2"
resolved "https://registry.yarnpkg.com/@solana/codecs-strings/-/codecs-strings-2.0.0-preview.2.tgz#8bd01a4e48614d5289d72d743c3e81305d445c46"
integrity sha512-EgBwY+lIaHHgMJIqVOGHfIfpdmmUDNoNO/GAUGeFPf+q0dF+DtwhJPEMShhzh64X2MeCZcmSO6Kinx0Bvmmz2g==
dependencies:
"@solana/codecs-core" "2.0.0-preview.2"
"@solana/codecs-numbers" "2.0.0-preview.2"
"@solana/errors" "2.0.0-preview.2"
"@solana/codecs-strings@2.0.0-preview.4":
version "2.0.0-preview.4"
resolved "https://registry.yarnpkg.com/@solana/codecs-strings/-/codecs-strings-2.0.0-preview.4.tgz#4d06bb722a55a5d04598d362021bfab4bd446760"
integrity sha512-YDbsQePRWm+xnrfS64losSGRg8Wb76cjK1K6qfR8LPmdwIC3787x9uW5/E4icl/k+9nwgbIRXZ65lpF+ucZUnw==
dependencies:
"@solana/codecs-core" "2.0.0-preview.4"
"@solana/codecs-numbers" "2.0.0-preview.4"
"@solana/errors" "2.0.0-preview.4"
"@solana/codecs@2.0.0-preview.2":
version "2.0.0-preview.2"
resolved "https://registry.yarnpkg.com/@solana/codecs/-/codecs-2.0.0-preview.2.tgz#d6615fec98f423166fb89409f9a4ad5b74c10935"
integrity sha512-4HHzCD5+pOSmSB71X6w9ptweV48Zj1Vqhe732+pcAQ2cMNnN0gMPMdDq7j3YwaZDZ7yrILVV/3+HTnfT77t2yA==
dependencies:
"@solana/codecs-core" "2.0.0-preview.2"
"@solana/codecs-data-structures" "2.0.0-preview.2"
"@solana/codecs-numbers" "2.0.0-preview.2"
"@solana/codecs-strings" "2.0.0-preview.2"
"@solana/options" "2.0.0-preview.2"
"@solana/codecs@2.0.0-preview.4":
version "2.0.0-preview.4"
resolved "https://registry.yarnpkg.com/@solana/codecs/-/codecs-2.0.0-preview.4.tgz#a1923cc78a6f64ebe656c7ec6335eb6b70405b22"
integrity sha512-gLMupqI4i+G4uPi2SGF/Tc1aXcviZF2ybC81x7Q/fARamNSgNOCUUoSCg9nWu1Gid6+UhA7LH80sWI8XjKaRog==
dependencies:
"@solana/codecs-core" "2.0.0-preview.4"
"@solana/codecs-data-structures" "2.0.0-preview.4"
"@solana/codecs-numbers" "2.0.0-preview.4"
"@solana/codecs-strings" "2.0.0-preview.4"
"@solana/options" "2.0.0-preview.4"
"@solana/errors@2.0.0-preview.2":
version "2.0.0-preview.2"
resolved "https://registry.yarnpkg.com/@solana/errors/-/errors-2.0.0-preview.2.tgz#e0ea8b008c5c02528d5855bc1903e5e9bbec322e"
integrity sha512-H2DZ1l3iYF5Rp5pPbJpmmtCauWeQXRJapkDg8epQ8BJ7cA2Ut/QEtC3CMmw/iMTcuS6uemFNLcWvlOfoQhvQuA==
dependencies:
chalk "^5.3.0"
commander "^12.0.0"
"@solana/errors@2.0.0-preview.4":
version "2.0.0-preview.4"
resolved "https://registry.yarnpkg.com/@solana/errors/-/errors-2.0.0-preview.4.tgz#056ba76b6dd900dafa70117311bec3aef0f5250b"
integrity sha512-kadtlbRv2LCWr8A9V22On15Us7Nn8BvqNaOB4hXsTB3O0fU40D1ru2l+cReqLcRPij4znqlRzW9Xi0m6J5DIhA==
dependencies:
chalk "^5.3.0"
commander "^12.1.0"
"@solana/options@2.0.0-experimental.8618508":
version "2.0.0-experimental.8618508"
resolved "https://registry.yarnpkg.com/@solana/options/-/options-2.0.0-experimental.8618508.tgz#95385340e85f9e8a81b2bfba089404a61c8e9520"
integrity sha512-fy/nIRAMC3QHvnKi63KEd86Xr/zFBVxNW4nEpVEU2OT0gCEKwHY4Z55YHf7XujhyuM3PNpiBKg/YYw5QlRU4vg==
dependencies:
"@solana/codecs-core" "2.0.0-experimental.8618508"
"@solana/codecs-numbers" "2.0.0-experimental.8618508"
"@solana/options@2.0.0-preview.2":
version "2.0.0-preview.2"
resolved "https://registry.yarnpkg.com/@solana/options/-/options-2.0.0-preview.2.tgz#13ff008bf43a5056ef9a091dc7bb3f39321e867e"
integrity sha512-FAHqEeH0cVsUOTzjl5OfUBw2cyT8d5Oekx4xcn5hn+NyPAfQJgM3CEThzgRD6Q/4mM5pVUnND3oK/Mt1RzSE/w==
dependencies:
"@solana/codecs-core" "2.0.0-preview.2"
"@solana/codecs-numbers" "2.0.0-preview.2"
"@solana/options@2.0.0-preview.4":
version "2.0.0-preview.4"
resolved "https://registry.yarnpkg.com/@solana/options/-/options-2.0.0-preview.4.tgz#212d35d1da87c7efb13de4d3569ad9eb070f013d"
integrity sha512-tv2O/Frxql/wSe3jbzi5nVicIWIus/BftH+5ZR+r9r3FO0/htEllZS5Q9XdbmSboHu+St87584JXeDx3xm4jaA==
dependencies:
"@solana/codecs-core" "2.0.0-preview.4"
"@solana/codecs-data-structures" "2.0.0-preview.4"
"@solana/codecs-numbers" "2.0.0-preview.4"
"@solana/codecs-strings" "2.0.0-preview.4"
"@solana/errors" "2.0.0-preview.4"
"@solana/spl-token-group@^0.0.5":
version "0.0.5"
resolved "https://registry.yarnpkg.com/@solana/spl-token-group/-/spl-token-group-0.0.5.tgz#f955dcca782031c85e862b2b46878d1bb02db6c2"
integrity sha512-CLJnWEcdoUBpQJfx9WEbX3h6nTdNiUzswfFdkABUik7HVwSNA98u5AYvBVK2H93d9PGMOHAak2lHW9xr+zAJGQ==
dependencies:
"@solana/codecs" "2.0.0-preview.4"
"@solana/spl-type-length-value" "0.1.0"
"@solana/spl-token-metadata@^0.1.2":
version "0.1.2"
resolved "https://registry.yarnpkg.com/@solana/spl-token-metadata/-/spl-token-metadata-0.1.2.tgz#876e13432bd2960bd3cac16b9b0af63e69e37719"
integrity sha512-hJYnAJNkDrtkE2Q41YZhCpeOGU/0JgRFXbtrtOuGGeKc3pkEUHB9DDoxZAxx+XRno13GozUleyBi0qypz4c3bw==
dependencies:
"@solana/codecs-core" "2.0.0-experimental.8618508"
"@solana/codecs-data-structures" "2.0.0-experimental.8618508"
"@solana/codecs-numbers" "2.0.0-experimental.8618508"
"@solana/codecs-strings" "2.0.0-experimental.8618508"
"@solana/options" "2.0.0-experimental.8618508"
"@solana/spl-type-length-value" "0.1.0"
"@solana/spl-token-metadata@^0.1.3":
version "0.1.4"
resolved "https://registry.yarnpkg.com/@solana/spl-token-metadata/-/spl-token-metadata-0.1.4.tgz#5cdc3b857a8c4a6877df24e24a8648c4132d22ba"
integrity sha512-N3gZ8DlW6NWDV28+vCCDJoTqaCZiF/jDUnk3o8GRkAFzHObiR60Bs1gXHBa8zCPdvOwiG6Z3dg5pg7+RW6XNsQ==
dependencies:
"@solana/codecs" "2.0.0-preview.2"
"@solana/spl-type-length-value" "0.1.0"
"@solana/spl-token@0.3.7":
version "0.3.7"
resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.3.7.tgz#6f027f9ad8e841f792c32e50920d9d2e714fc8da"
integrity sha512-bKGxWTtIw6VDdCBngjtsGlKGLSmiu/8ghSt/IOYJV24BsymRbgq7r12GToeetpxmPaZYLddKwAz7+EwprLfkfg==
dependencies:
"@solana/buffer-layout" "^4.0.0"
"@solana/buffer-layout-utils" "^0.2.0"
buffer "^6.0.3"
"@solana/spl-token@^0.1.6":
version "0.1.8"
resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.1.8.tgz#f06e746341ef8d04165e21fc7f555492a2a0faa6"
integrity sha512-LZmYCKcPQDtJgecvWOgT/cnoIQPWjdH+QVyzPcFvyDUiT0DiRjZaam4aqNUyvchLFhzgunv3d9xOoyE34ofdoQ==
dependencies:
"@babel/runtime" "^7.10.5"
"@solana/web3.js" "^1.21.0"
bn.js "^5.1.0"
buffer "6.0.3"
buffer-layout "^1.2.0"
dotenv "10.0.0"
"@solana/spl-token@^0.3.4", "@solana/spl-token@^0.3.7":
version "0.3.11"
resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.3.11.tgz#cdc10f9472b29b39c8983c92592cadd06627fb9a"
integrity sha512-bvohO3rIMSVL24Pb+I4EYTJ6cL82eFpInEXD/I8K8upOGjpqHsKUoAempR/RnUlI1qSFNyFlWJfu6MNUgfbCQQ==
dependencies:
"@solana/buffer-layout" "^4.0.0"
"@solana/buffer-layout-utils" "^0.2.0"
"@solana/spl-token-metadata" "^0.1.2"
buffer "^6.0.3"
"@solana/spl-token@^0.4.0":
version "0.4.8"
resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.4.8.tgz#a84e4131af957fa9fbd2727e5fc45dfbf9083586"
integrity sha512-RO0JD9vPRi4LsAbMUdNbDJ5/cv2z11MGhtAvFeRzT4+hAGE/FUzRi0tkkWtuCfSIU3twC6CtmAihRp/+XXjWsA==
dependencies:
"@solana/buffer-layout" "^4.0.0"
"@solana/buffer-layout-utils" "^0.2.0"
"@solana/spl-token-group" "^0.0.5"
"@solana/spl-token-metadata" "^0.1.3"
buffer "^6.0.3"
"@solana/spl-type-length-value@0.1.0":
version "0.1.0"
resolved "https://registry.yarnpkg.com/@solana/spl-type-length-value/-/spl-type-length-value-0.1.0.tgz#b5930cf6c6d8f50c7ff2a70463728a4637a2f26b"
integrity sha512-JBMGB0oR4lPttOZ5XiUGyvylwLQjt1CPJa6qQ5oM+MBCndfjz2TKKkw0eATlLLcYmq1jBVsNlJ2cD6ns2GR7lA==
dependencies:
buffer "^6.0.3"
"@solana/web3.js@1.91.7":
version "1.91.7"
resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.91.7.tgz#1d639f8f3cc772fd6d88b982e8fdb17dc192b9e1"
integrity sha512-HqljZKDwk6Z4TajKRGhGLlRsbGK4S8EY27DA7v1z6yakewiUY3J7ZKDZRxcqz2MYV/ZXRrJ6wnnpiHFkPdv0WA==
dependencies:
"@babel/runtime" "^7.23.4"
"@noble/curves" "^1.4.0"
"@noble/hashes" "^1.3.3"
"@solana/buffer-layout" "^4.0.1"
agentkeepalive "^4.5.0"
bigint-buffer "^1.1.5"
bn.js "^5.2.1"
borsh "^0.7.0"
bs58 "^4.0.1"
buffer "6.0.3"
fast-stable-stringify "^1.0.0"
jayson "^4.1.0"
node-fetch "^2.7.0"
rpc-websockets "^7.5.1"
superstruct "^0.14.2"
"@solana/web3.js@1.92.3":
version "1.92.3"
resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.92.3.tgz#8880b446c0ec30fc552e1d501bd8db2780a1f70c"
integrity sha512-NVBWvb9zdJIAx6X+caXaIICCEQfQaQ8ygykCjJW4u2z/sIKcvPj3ZIIllnx0MWMc3IxGq15ozGYDOQIMbwUcHw==
dependencies:
"@babel/runtime" "^7.24.6"
"@noble/curves" "^1.4.0"
"@noble/hashes" "^1.4.0"
"@solana/buffer-layout" "^4.0.1"
agentkeepalive "^4.5.0"
bigint-buffer "^1.1.5"
bn.js "^5.2.1"
borsh "^0.7.0"
bs58 "^4.0.1"
buffer "6.0.3"
fast-stable-stringify "^1.0.0"
jayson "^4.1.0"
node-fetch "^2.7.0"
rpc-websockets "^8.0.1"
superstruct "^1.0.4"
"@solana/web3.js@^1.17.0", "@solana/web3.js@^1.21.0", "@solana/web3.js@^1.30.2", "@solana/web3.js@^1.32.0", "@solana/web3.js@^1.36.0", "@solana/web3.js@^1.56.2", "@solana/web3.js@^1.68.0":
version "1.91.4"
resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.91.4.tgz#b80295ce72aa125930dfc5b41b4b4e3f85fd87fa"
integrity sha512-zconqecIcBqEF6JiM4xYF865Xc4aas+iWK5qnu7nwKPq9ilRYcn+2GiwpYXqUqqBUe0XCO17w18KO0F8h+QATg==
dependencies:
"@babel/runtime" "^7.23.4"
"@noble/curves" "^1.2.0"
"@noble/hashes" "^1.3.3"
"@solana/buffer-layout" "^4.0.1"
agentkeepalive "^4.5.0"
bigint-buffer "^1.1.5"
bn.js "^5.2.1"
borsh "^0.7.0"
bs58 "^4.0.1"
buffer "6.0.3"
fast-stable-stringify "^1.0.0"
jayson "^4.1.0"
node-fetch "^2.7.0"
rpc-websockets "^7.5.1"
superstruct "^0.14.2"
"@solana/web3.js@^1.54.0", "@solana/web3.js@^1.93.0", "@solana/web3.js@^1.95.0":
version "1.95.1"
resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.95.1.tgz#fcbbaf845309ff7ceb8d3726702799e8c27530e8"
integrity sha512-mRX/AjV6QbiOXpWcy5Rz1ZWEH2lVkwO7T0pcv9t97ACpv3/i3tPiqXwk0JIZgSR3wOSTiT26JfygnJH2ulS6dQ==
dependencies:
"@babel/runtime" "^7.24.8"
"@noble/curves" "^1.4.2"
"@noble/hashes" "^1.4.0"
"@solana/buffer-layout" "^4.0.1"
agentkeepalive "^4.5.0"
bigint-buffer "^1.1.5"
bn.js "^5.2.1"
borsh "^0.7.0"
bs58 "^4.0.1"
buffer "6.0.3"
fast-stable-stringify "^1.0.0"
jayson "^4.1.1"
node-fetch "^2.7.0"
rpc-websockets "^9.0.2"
superstruct "^2.0.2"
"@solana/web3.js@^1.77.3":
version "1.95.2"
resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.95.2.tgz#6f8a0362fa75886a21550dbec49aad54481463a6"
integrity sha512-SjlHp0G4qhuhkQQc+YXdGkI8EerCqwxvgytMgBpzMUQTafrkNant3e7pgilBGgjy/iM40ICvWBLgASTPMrQU7w==
dependencies:
"@babel/runtime" "^7.24.8"
"@noble/curves" "^1.4.2"
"@noble/hashes" "^1.4.0"
"@solana/buffer-layout" "^4.0.1"
agentkeepalive "^4.5.0"
bigint-buffer "^1.1.5"
bn.js "^5.2.1"
borsh "^0.7.0"
bs58 "^4.0.1"
buffer "6.0.3"
fast-stable-stringify "^1.0.0"
jayson "^4.1.1"
node-fetch "^2.7.0"
rpc-websockets "^9.0.2"
superstruct "^2.0.2"
"@solana/web3.js@^1.90.0":
version "1.93.0"
resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.93.0.tgz#4b6975020993cec2f6626e4f2bf559ca042df8db"
integrity sha512-suf4VYwWxERz4tKoPpXCRHFRNst7jmcFUaD65kII+zg9urpy5PeeqgLV6G5eWGzcVzA9tZeXOju1A1Y+0ojEVw==
dependencies:
"@babel/runtime" "^7.24.7"
"@noble/curves" "^1.4.0"
"@noble/hashes" "^1.4.0"
"@solana/buffer-layout" "^4.0.1"
agentkeepalive "^4.5.0"
bigint-buffer "^1.1.5"
bn.js "^5.2.1"
borsh "^0.7.0"
bs58 "^4.0.1"
buffer "6.0.3"
fast-stable-stringify "^1.0.0"
jayson "^4.1.0"
node-fetch "^2.7.0"
rpc-websockets "^9.0.0"
superstruct "^1.0.4"
"@solana/web3.js@~1.77.3":
version "1.77.4"
resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.77.4.tgz#aad8c44a02ced319493308ef765a2b36a9e9fa8c"
integrity sha512-XdN0Lh4jdY7J8FYMyucxCwzn6Ga2Sr1DHDWRbqVzk7ZPmmpSPOVWHzO67X1cVT+jNi1D6gZi2tgjHgDPuj6e9Q==
dependencies:
"@babel/runtime" "^7.12.5"
"@noble/curves" "^1.0.0"
"@noble/hashes" "^1.3.0"
"@solana/buffer-layout" "^4.0.0"
agentkeepalive "^4.2.1"
bigint-buffer "^1.1.5"
bn.js "^5.0.0"
borsh "^0.7.0"
bs58 "^4.0.1"
buffer "6.0.3"
fast-stable-stringify "^1.0.0"
jayson "^4.1.0"
node-fetch "^2.6.7"
rpc-websockets "^7.5.1"
superstruct "^0.14.2"
"@solworks/soltoolkit-sdk@^0.0.23":
version "0.0.23"
resolved "https://registry.yarnpkg.com/@solworks/soltoolkit-sdk/-/soltoolkit-sdk-0.0.23.tgz#ef32d0aa79f888bcf0f639d280005b2e97cdc624"
integrity sha512-O6lXT3EBR4gmcjt0/33i97VMHVEImwXGi+4TNrDDdifn3tyOUB7V6PR1VGxlavQb9hqmVai3xhedg/rmbQzX7w==
dependencies:
"@solana/buffer-layout" "^4.0.0"
"@solana/spl-token" "^0.3.4"
"@solana/web3.js" "^1.54.0"
"@types/bn.js" "^5.1.0"
"@types/node" "^18.7.13"
"@types/node-fetch" "^2.6.2"
bn.js "^5.2.1"
decimal.js "^10.4.0"
typescript "^4.8.2"
"@soncodi/signal@~2.0.7":
version "2.0.7"
resolved "https://registry.yarnpkg.com/@soncodi/signal/-/signal-2.0.7.tgz#0a2c361b02dbfdbcf4e66b78e5f711e0a13d6e83"
integrity sha512-zA2oZluZmVvgZEDjF243KWD1S2J+1SH1MVynI0O1KRgDt1lU8nqk7AK3oQfW/WpwT51L5waGSU0xKF/9BTP5Cw==
"@swc/helpers@^0.5.11":
version "0.5.11"
resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.11.tgz#5bab8c660a6e23c13b2d23fcd1ee44a2db1b0cb7"
integrity sha512-YNlnKRWF2sVojTpIyzwou9XoTNbzbzONwRhOoniEioF1AtaitTvVZblaQRrAzChWQ1bLYyYSWzM18y4WwgzJ+A==
dependencies:
tslib "^2.4.0"
"@switchboard-xyz/common@^2.5.0":
version "2.5.0"
resolved "https://registry.yarnpkg.com/@switchboard-xyz/common/-/common-2.5.0.tgz#15f60abd0c2503d855caf6f120ed98f8f0dd9d25"
integrity sha512-BgQTvqOZGZxMSscy2x3GHrs2/BRhFf55t7QrqVdED1KneCP0KgcZn436GjGttc61nP2i8Yd7VoJzTNksezn2kA==
dependencies:
"@solana/web3.js" "^1.93.0"
axios "^1.7.2"
big.js "^6.2.1"
bn.js "^5.2.1"
bs58 "^5.0.0"
cron-validator "^1.3.1"
decimal.js "^10.4.3"
js-sha256 "^0.11.0"
lodash "^4.17.21"
protobufjs "^7.2.6"
yaml "^2.5.0"
"@switchboard-xyz/on-demand@1.2.42":
version "1.2.42"
resolved "https://registry.yarnpkg.com/@switchboard-xyz/on-demand/-/on-demand-1.2.42.tgz#1ec8ae18381baa66e20341648a1cdbd3c30efc8f"
integrity sha512-Q2qMpBM95RIDhGWA5vqRrAySRYncWKa7QWpAwLaIu5xPZMlSqNo12+lX30fUnqTWVeIXey/rp/3n6yOJLBsjjA==
dependencies:
"@brokerloop/ttlcache" "^3.2.3"
"@coral-xyz/anchor-30" "npm:@coral-xyz/anchor@0.30.1"
"@solana/web3.js" "^1.95.0"
"@solworks/soltoolkit-sdk" "^0.0.23"
"@switchboard-xyz/common" "^2.5.0"
axios "^1.7.4"
big.js "^6.2.1"
bs58 "^5.0.0"
js-yaml "^4.1.0"
protobufjs "^7.2.6"
"@triton-one/yellowstone-grpc@1.3.0":
version "1.3.0"
resolved "https://registry.yarnpkg.com/@triton-one/yellowstone-grpc/-/yellowstone-grpc-1.3.0.tgz#7caa7006b525149b4780d1295c7d4c34bc6a6ff6"
integrity sha512-tuwHtoYzvqnahsMrecfNNkQceCYwgiY0qKS8RwqtaxvDEgjm0E+0bXwKz2eUD3ZFYifomJmRKDmSBx9yQzAeMQ==
dependencies:
"@grpc/grpc-js" "^1.8.0"
"@tsconfig/node10@^1.0.7":
version "1.0.9"
resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2"
integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==
"@tsconfig/node12@^1.0.7":
version "1.0.11"
resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d"
integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==
"@tsconfig/node14@^1.0.0":
version "1.0.3"
resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1"
integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==
"@tsconfig/node16@^1.0.2":
version "1.0.4"
resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9"
integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==
"@types/accepts@*":
version "1.3.7"
resolved "https://registry.yarnpkg.com/@types/accepts/-/accepts-1.3.7.tgz#3b98b1889d2b2386604c2bbbe62e4fb51e95b265"
integrity sha512-Pay9fq2lM2wXPWbteBsRAGiWH2hig4ZE2asK+mm7kUzlxRTfL961rj89I6zV/E3PcIkDqyuBEcMxFT7rccugeQ==
dependencies:
"@types/node" "*"
"@types/amqplib@^0.5.17":
version "0.5.17"
resolved "https://registry.yarnpkg.com/@types/amqplib/-/amqplib-0.5.17.tgz#1211f5e01b62006e8a380af258d147de0b3b22e0"
integrity sha512-RImqiLP1swDqWBW8UX9iBXVEOw6MYzNmxdXqfemDfdwtUvdTM/W0s2RlSuMVIGkRhaWvpkC9O/N81VzzQwfAbw==
dependencies:
"@types/bluebird" "*"
"@types/node" "*"
"@types/aws-lambda@8.10.81":
version "8.10.81"
resolved "https://registry.yarnpkg.com/@types/aws-lambda/-/aws-lambda-8.10.81.tgz#6d405269aad82e05a348687631aa9a587cdbe158"
integrity sha512-C1rFKGVZ8KwqhwBOYlpoybTSRtxu2433ea6JaO3amc6ubEe08yQoFsPa9aU9YqvX7ppeZ25CnCtC4AH9mhtxsQ==
"@types/bluebird@*":
version "3.5.42"
resolved "https://registry.yarnpkg.com/@types/bluebird/-/bluebird-3.5.42.tgz#7ec05f1ce9986d920313c1377a5662b1b563d366"
integrity sha512-Jhy+MWRlro6UjVi578V/4ZGNfeCOcNCp0YaFNIUGFKlImowqwb1O/22wDVk3FDGMLqxdpOV3qQHD5fPEH4hK6A==
"@types/bn.js@5.1.5", "@types/bn.js@^5.1.0":
version "5.1.5"
resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.5.tgz#2e0dacdcce2c0f16b905d20ff87aedbc6f7b4bf0"
integrity sha512-V46N0zwKRF5Q00AZ6hWtN0T8gGmDUaUzLWQvHFo5yThtVwK/VCenFY3wXVbOvNfajEpsTfQM4IN9k/d6gUVX3A==
dependencies:
"@types/node" "*"
"@types/body-parser@*":
version "1.19.5"
resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.5.tgz#04ce9a3b677dc8bd681a17da1ab9835dc9d3ede4"
integrity sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==
dependencies:
"@types/connect" "*"
"@types/node" "*"
"@types/bs58@^4.0.4":
version "4.0.4"
resolved "https://registry.yarnpkg.com/@types/bs58/-/bs58-4.0.4.tgz#49fbcb0c7db5f7cea26f0e0f61dc4a41a2445aab"
integrity sha512-0IEpMFXXQi2zXaXl9GJ3sRwQo0uEkD+yFOv+FnAU5lkPtcu6h61xb7jc2CFPEZ5BUOaiP13ThuGc9HD4R8lR5g==
dependencies:
"@types/node" "*"
base-x "^3.0.6"
"@types/bson@*":
version "4.2.0"
resolved "https://registry.yarnpkg.com/@types/bson/-/bson-4.2.0.tgz#a2f71e933ff54b2c3bf267b67fa221e295a33337"
integrity sha512-ELCPqAdroMdcuxqwMgUpifQyRoTpyYCNr1V9xKyF40VsBobsj+BbWNRvwGchMgBPGqkw655ypkjj2MEF5ywVwg==
dependencies:
bson "*"
"@types/bunyan@*":
version "1.8.11"
resolved "https://registry.yarnpkg.com/@types/bunyan/-/bunyan-1.8.11.tgz#0b9e7578a5aa2390faf12a460827154902299638"
integrity sha512-758fRH7umIMk5qt5ELmRMff4mLDlN+xyYzC+dkPTdKwbSkJFvz6xwyScrytPU0QIBbRRwbiE8/BIg8bpajerNQ==
dependencies:
"@types/node" "*"
"@types/bunyan@1.8.7":
version "1.8.7"
resolved "https://registry.yarnpkg.com/@types/bunyan/-/bunyan-1.8.7.tgz#63cc65b5ecff6217d1509409a575e7b991f80831"
integrity sha512-jaNt6xX5poSmXuDAkQrSqx2zkR66OrdRDuVnU8ldvn3k/Ci/7Sf5nooKspQWimDnw337Bzt/yirqSThTjvrHkg==
dependencies:
"@types/node" "*"
"@types/chai@4.3.11":
version "4.3.11"
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.11.tgz#e95050bf79a932cb7305dd130254ccdf9bde671c"
integrity sha512-qQR1dr2rGIHYlJulmr8Ioq3De0Le9E4MJ5AiaeAETJJpndT1uUNHsGFK3L/UIu+rbkQSdj8J/w2bCsBZc/Y5fQ==
"@types/connect@*", "@types/connect@^3.4.33":
version "3.4.38"
resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.38.tgz#5ba7f3bc4fbbdeaff8dded952e5ff2cc53f8d858"
integrity sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==
dependencies:
"@types/node" "*"
"@types/connect@3.4.35":
version "3.4.35"
resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1"
integrity sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==
dependencies:
"@types/node" "*"
"@types/content-disposition@*":
version "0.5.8"
resolved "https://registry.yarnpkg.com/@types/content-disposition/-/content-disposition-0.5.8.tgz#6742a5971f490dc41e59d277eee71361fea0b537"
integrity sha512-QVSSvno3dE0MgO76pJhmv4Qyi/j0Yk9pBp0Y7TJ2Tlj+KCgJWY6qX7nnxCOLkZ3VYRSIk1WTxCvwUSdx6CCLdg==
"@types/cookies@*":
version "0.7.10"
resolved "https://registry.yarnpkg.com/@types/cookies/-/cookies-0.7.10.tgz#c4881dca4dd913420c488508d192496c46eb4fd0"
integrity sha512-hmUCjAk2fwZVPPkkPBcI7jGLIR5mg4OVoNMBwU6aVsMm/iNPY7z9/R+x2fSwLt/ZXoGua6C5Zy2k5xOo9jUyhQ==
dependencies:
"@types/connect" "*"
"@types/express" "*"
"@types/keygrip" "*"
"@types/node" "*"
"@types/express-serve-static-core@^4.17.18", "@types/express-serve-static-core@^4.17.33":
version "4.17.41"
resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.41.tgz#5077defa630c2e8d28aa9ffc2c01c157c305bef6"
integrity sha512-OaJ7XLaelTgrvlZD8/aa0vvvxZdUmlCn6MtWeB7TkiKW70BQLc9XEPpDLPdbo52ZhXUCrznlWdCHWxJWtdyajA==
dependencies:
"@types/node" "*"
"@types/qs" "*"
"@types/range-parser" "*"
"@types/send" "*"
"@types/express@*":
version "4.17.21"
resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.21.tgz#c26d4a151e60efe0084b23dc3369ebc631ed192d"
integrity sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==
dependencies:
"@types/body-parser" "*"
"@types/express-serve-static-core" "^4.17.33"
"@types/qs" "*"
"@types/serve-static" "*"
"@types/express@4.17.13":
version "4.17.13"
resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.13.tgz#a76e2995728999bab51a33fabce1d705a3709034"
integrity sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==
dependencies:
"@types/body-parser" "*"
"@types/express-serve-static-core" "^4.17.18"
"@types/qs" "*"
"@types/serve-static" "*"
"@types/generic-pool@^3.1.9":
version "3.8.1"
resolved "https://registry.yarnpkg.com/@types/generic-pool/-/generic-pool-3.8.1.tgz#b9b25b2ba4733057fa5df1818352d3205c48e87b"
integrity sha512-eaMAbZS0EfKvaP5PUZ/Cdf5uJBO2t6T3RdvQTKuMqUwGhNpCnPAsKWEMyV+mCeCQG3UiHrtgdzni8X6DmhxRaQ==
dependencies:
generic-pool "*"
"@types/hapi__catbox@*":
version "10.2.6"
resolved "https://registry.yarnpkg.com/@types/hapi__catbox/-/hapi__catbox-10.2.6.tgz#e516bfb4e461441b4ea7f9be870e48864a289494"
integrity sha512-qdMHk4fBlwRfnBBDJaoaxb+fU9Ewi2xqkXD3mNjSPl2v/G/8IJbDpVRBuIcF7oXrcE8YebU5M8cCeKh1NXEn0w==
"@types/hapi__hapi@20.0.9":
version "20.0.9"
resolved "https://registry.yarnpkg.com/@types/hapi__hapi/-/hapi__hapi-20.0.9.tgz#9d570846c96268266a14c970c13aeeaccfc8e172"
integrity sha512-fGpKScknCKZityRXdZgpCLGbm41R1ppFgnKHerfZlqOOlCX/jI129S6ghgBqkqCE8m9A0CIu1h7Ch04lD9KOoA==
dependencies:
"@hapi/boom" "^9.0.0"
"@hapi/iron" "^6.0.0"
"@hapi/podium" "^4.1.3"
"@types/hapi__catbox" "*"
"@types/hapi__mimos" "*"
"@types/hapi__shot" "*"
"@types/node" "*"
joi "^17.3.0"
"@types/hapi__mimos@*":
version "4.1.4"
resolved "https://registry.yarnpkg.com/@types/hapi__mimos/-/hapi__mimos-4.1.4.tgz#4f8a1c58345fc468553708d3cb508724aa081bd9"
integrity sha512-i9hvJpFYTT/qzB5xKWvDYaSXrIiNqi4ephi+5Lo6+DoQdwqPXQgmVVOZR+s3MBiHoFqsCZCX9TmVWG3HczmTEQ==
dependencies:
"@types/mime-db" "*"
"@types/hapi__shot@*":
version "4.1.6"
resolved "https://registry.yarnpkg.com/@types/hapi__shot/-/hapi__shot-4.1.6.tgz#ee45d9a4a4e109a8d623e4f5f58ae2d8bd7c0773"
integrity sha512-h33NBjx2WyOs/9JgcFeFhkxnioYWQAZxOHdmqDuoJ1Qjxpcs+JGvSjEEoDeWfcrF+1n47kKgqph5IpfmPOnzbg==
dependencies:
"@types/node" "*"
"@types/http-assert@*":
version "1.5.5"
resolved "https://registry.yarnpkg.com/@types/http-assert/-/http-assert-1.5.5.tgz#dfb1063eb7c240ee3d3fe213dac5671cfb6a8dbf"
integrity sha512-4+tE/lwdAahgZT1g30Jkdm9PzFRde0xwxBNUyRsCitRvCQB90iuA2uJYdUnhnANRcqGXaWOGY4FEoxeElNAK2g==
"@types/http-errors@*":
version "2.0.4"
resolved "https://registry.yarnpkg.com/@types/http-errors/-/http-errors-2.0.4.tgz#7eb47726c391b7345a6ec35ad7f4de469cf5ba4f"
integrity sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==
"@types/ioredis@4.26.6":
version "4.26.6"
resolved "https://registry.yarnpkg.com/@types/ioredis/-/ioredis-4.26.6.tgz#7e332d6d24f12d79a1099834ccfa0c169ef667ed"
integrity sha512-Q9ydXL/5Mot751i7WLCm9OGTj5jlW3XBdkdEW21SkXZ8Y03srbkluFGbM3q8c+vzPW30JOLJ+NsZWHoly0+13A==
dependencies:
"@types/node" "*"
"@types/json-schema@^7.0.9":
version "7.0.15"
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841"
integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==
"@types/keygrip@*":
version "1.0.6"
resolved "https://registry.yarnpkg.com/@types/keygrip/-/keygrip-1.0.6.tgz#1749535181a2a9b02ac04a797550a8787345b740"
integrity sha512-lZuNAY9xeJt7Bx4t4dx0rYCDqGPW8RXhQZK1td7d4H6E9zYbLoOtjBvfwdTKpsyxQI/2jv+armjX/RW+ZNpXOQ==
"@types/koa-compose@*":
version "3.2.8"
resolved "https://registry.yarnpkg.com/@types/koa-compose/-/koa-compose-3.2.8.tgz#dec48de1f6b3d87f87320097686a915f1e954b57"
integrity sha512-4Olc63RY+MKvxMwVknCUDhRQX1pFQoBZ/lXcRLP69PQkEpze/0cr8LNqJQe5NFb/b19DWi2a5bTi2VAlQzhJuA==
dependencies:
"@types/koa" "*"
"@types/koa@*":
version "2.13.12"
resolved "https://registry.yarnpkg.com/@types/koa/-/koa-2.13.12.tgz#70d87a9061a81909e0ee11ca50168416e8d3e795"
integrity sha512-vAo1KuDSYWFDB4Cs80CHvfmzSQWeUb909aQib0C0aFx4sw0K9UZFz2m5jaEP+b3X1+yr904iQiruS0hXi31jbw==
dependencies:
"@types/accepts" "*"
"@types/content-disposition" "*"
"@types/cookies" "*"
"@types/http-assert" "*"
"@types/http-errors" "*"
"@types/keygrip" "*"
"@types/koa-compose" "*"
"@types/node" "*"
"@types/koa@2.13.4":
version "2.13.4"
resolved "https://registry.yarnpkg.com/@types/koa/-/koa-2.13.4.tgz#10620b3f24a8027ef5cbae88b393d1b31205726b"
integrity sha512-dfHYMfU+z/vKtQB7NUrthdAEiSvnLebvBjwHtfFmpZmB7em2N3WVQdHgnFq+xvyVgxW5jKDmjWfLD3lw4g4uTw==
dependencies:
"@types/accepts" "*"
"@types/content-disposition" "*"
"@types/cookies" "*"
"@types/http-assert" "*"
"@types/http-errors" "*"
"@types/keygrip" "*"
"@types/koa-compose" "*"
"@types/node" "*"
"@types/koa__router@8.0.7":
version "8.0.7"
resolved "https://registry.yarnpkg.com/@types/koa__router/-/koa__router-8.0.7.tgz#663d69d5ddebff5aaca27c0594430b3ba6ea20be"
integrity sha512-OB3Ax75nmTP+WR9AgdzA42DI7YmBtiNKN2g1Wxl+d5Dyek9SWt740t+ukwXSmv/jMBCUPyV3YEI93vZHgdP7UQ==
dependencies:
"@types/koa" "*"
"@types/memcached@^2.2.6":
version "2.2.10"
resolved "https://registry.yarnpkg.com/@types/memcached/-/memcached-2.2.10.tgz#113f9e3a451d6b5e0a3822e06d9feb52e63e954a"
integrity sha512-AM9smvZN55Gzs2wRrqeMHVP7KE8KWgCJO/XL5yCly2xF6EKa4YlbpK+cLSAH4NG/Ah64HrlegmGqW8kYws7Vxg==
dependencies:
"@types/node" "*"
"@types/mime-db@*":
version "1.43.5"
resolved "https://registry.yarnpkg.com/@types/mime-db/-/mime-db-1.43.5.tgz#7a3f53dc2125a91f4e0e41f1353f60f8b6af609e"
integrity sha512-/bfTiIUTNPUBnwnYvUxXAre5MhD88jgagLEQiQtIASjU+bwxd8kS/ASDA4a8ufd8m0Lheu6eeMJHEUpLHoJ28A==
"@types/mime@*":
version "3.0.4"
resolved "https://registry.yarnpkg.com/@types/mime/-/mime-3.0.4.tgz#2198ac274de6017b44d941e00261d5bc6a0e0a45"
integrity sha512-iJt33IQnVRkqeqC7PzBHPTC6fDlRNRW8vjrgqtScAhrmMwe8c4Eo7+fUGTa+XdWrpEgpyKWMYmi2dIwMAYRzPw==
"@types/mime@^1":
version "1.3.5"
resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.5.tgz#1ef302e01cf7d2b5a0fa526790c9123bf1d06690"
integrity sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==
"@types/minimist@1.2.5":
version "1.2.5"
resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.5.tgz#ec10755e871497bcd83efe927e43ec46e8c0747e"
integrity sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==
"@types/mocha@10.0.6":
version "10.0.6"
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-10.0.6.tgz#818551d39113081048bdddbef96701b4e8bb9d1b"
integrity sha512-dJvrYWxP/UcXm36Qn36fxhUKu8A/xMRXVT2cliFF1Z7UA9liG5Psj3ezNSZw+5puH2czDXRLcXQxf8JbJt0ejg==
"@types/mongodb@3.6.20":
version "3.6.20"
resolved "https://registry.yarnpkg.com/@types/mongodb/-/mongodb-3.6.20.tgz#b7c5c580644f6364002b649af1c06c3c0454e1d2"
integrity sha512-WcdpPJCakFzcWWD9juKoZbRtQxKIMYF/JIAM4JrNHrMcnJL6/a2NWjXxW7fo9hxboxxkg+icff8d7+WIEvKgYQ==
dependencies:
"@types/bson" "*"
"@types/node" "*"
"@types/mysql@2.15.19":
version "2.15.19"
resolved "https://registry.yarnpkg.com/@types/mysql/-/mysql-2.15.19.tgz#d158927bb7c1a78f77e56de861a3b15cae0e7aed"
integrity sha512-wSRg2QZv14CWcZXkgdvHbbV2ACufNy5EgI8mBBxnJIptchv7DBy/h53VMa2jDhyo0C9MO4iowE6z9vF8Ja1DkQ==
dependencies:
"@types/node" "*"
"@types/node-fetch@^2.6.2":
version "2.6.11"
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.11.tgz#9b39b78665dae0e82a08f02f4967d62c66f95d24"
integrity sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==
dependencies:
"@types/node" "*"
form-data "^4.0.0"
"@types/node@*":
version "20.12.7"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.12.7.tgz#04080362fa3dd6c5822061aa3124f5c152cff384"
integrity sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==
dependencies:
undici-types "~5.26.4"
"@types/node@>=12.12.47", "@types/node@>=13.7.0":
version "20.10.3"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.3.tgz#4900adcc7fc189d5af5bb41da8f543cea6962030"
integrity sha512-XJavIpZqiXID5Yxnxv3RUDKTN5b81ddNC3ecsA0SoFXz/QU8OGBwZGMomiq0zw+uuqbL/krztv/DINAQ/EV4gg==
dependencies:
undici-types "~5.26.4"
"@types/node@^12.12.54":
version "12.20.55"
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240"
integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==
"@types/node@^18.11.13":
version "18.19.31"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.31.tgz#b7d4a00f7cb826b60a543cebdbda5d189aaecdcd"
integrity sha512-ArgCD39YpyyrtFKIqMDvjz79jto5fcI/SVUs2HwB+f0dAzq68yqOdyaSivLiLugSziTpNXLQrVb7RZFmdZzbhA==
dependencies:
undici-types "~5.26.4"
"@types/node@^18.7.13":
version "18.19.42"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.42.tgz#b54ed4752c85427906aab40917b0f7f3d724bf72"
integrity sha512-d2ZFc/3lnK2YCYhos8iaNIYu9Vfhr92nHiyJHRltXWjXUBjEE+A4I58Tdbnw4VhggSW+2j5y5gTrLs4biNnubg==
dependencies:
undici-types "~5.26.4"
"@types/pg-pool@2.0.3":
version "2.0.3"
resolved "https://registry.yarnpkg.com/@types/pg-pool/-/pg-pool-2.0.3.tgz#3eb8df2933f617f219a53091ad4080c94ba1c959"
integrity sha512-fwK5WtG42Yb5RxAwxm3Cc2dJ39FlgcaNiXKvtTLAwtCn642X7dgel+w1+cLWwpSOFImR3YjsZtbkfjxbHtFAeg==
dependencies:
"@types/pg" "*"
"@types/pg@*":
version "8.10.9"
resolved "https://registry.yarnpkg.com/@types/pg/-/pg-8.10.9.tgz#d20bb948c6268c5bd847e2bf968f1194c5a2355a"
integrity sha512-UksbANNE/f8w0wOMxVKKIrLCbEMV+oM1uKejmwXr39olg4xqcfBDbXxObJAt6XxHbDa4XTKOlUEcEltXDX+XLQ==
dependencies:
"@types/node" "*"
pg-protocol "*"
pg-types "^4.0.1"
"@types/pg@8.6.1":
version "8.6.1"
resolved "https://registry.yarnpkg.com/@types/pg/-/pg-8.6.1.tgz#099450b8dc977e8197a44f5229cedef95c8747f9"
integrity sha512-1Kc4oAGzAl7uqUStZCDvaLFqZrW9qWSjXOmBfdgyBP5La7Us6Mg4GBvRlSoaZMhQF/zSj1C8CtKMBkoiT8eL8w==
dependencies:
"@types/node" "*"
pg-protocol "*"
pg-types "^2.2.0"
"@types/qs@*":
version "6.9.10"
resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.10.tgz#0af26845b5067e1c9a622658a51f60a3934d51e8"
integrity sha512-3Gnx08Ns1sEoCrWssEgTSJs/rsT2vhGP+Ja9cnnk9k4ALxinORlQneLXFeFKOTJMOeZUFD1s7w+w2AphTpvzZw==
"@types/range-parser@*":
version "1.2.7"
resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.7.tgz#50ae4353eaaddc04044279812f52c8c65857dbcb"
integrity sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==
"@types/redis@2.8.31":
version "2.8.31"
resolved "https://registry.yarnpkg.com/@types/redis/-/redis-2.8.31.tgz#c11c1b269fec132ac2ec9eb891edf72fc549149e"
integrity sha512-daWrrTDYaa5iSDFbgzZ9gOOzyp2AJmYK59OlG/2KGBgYWF3lfs8GDKm1c//tik5Uc93hDD36O+qLPvzDolChbA==
dependencies:
"@types/node" "*"
"@types/restify@4.3.8":
version "4.3.8"
resolved "https://registry.yarnpkg.com/@types/restify/-/restify-4.3.8.tgz#1e504995ef770a7149271e2cd639767cc7925245"
integrity sha512-BdpKcY4mnbdd7RNLfVRutkUtI1tGKMbQVKm7YgWi4kTlRm3Z4hh+F+1R1va/PZmkkk0AEt7kP82qi1jcF6Hshg==
dependencies:
"@types/bunyan" "*"
"@types/node" "*"
"@types/semver@^7.3.12":
version "7.5.6"
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.6.tgz#c65b2bfce1bec346582c07724e3f8c1017a20339"
integrity sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==
"@types/send@*":
version "0.17.4"
resolved "https://registry.yarnpkg.com/@types/send/-/send-0.17.4.tgz#6619cd24e7270793702e4e6a4b958a9010cfc57a"
integrity sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==
dependencies:
"@types/mime" "^1"
"@types/node" "*"
"@types/serve-static@*":
version "1.15.5"
resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.15.5.tgz#15e67500ec40789a1e8c9defc2d32a896f05b033"
integrity sha512-PDRk21MnK70hja/YF8AHfC7yIsiQHn1rcXx7ijCFBX/k+XQJhQT/gw3xekXKJvx+5SXaMMS8oqQy09Mzvz2TuQ==
dependencies:
"@types/http-errors" "*"
"@types/mime" "*"
"@types/node" "*"
"@types/triple-beam@^1.3.2":
version "1.3.5"
resolved "https://registry.yarnpkg.com/@types/triple-beam/-/triple-beam-1.3.5.tgz#74fef9ffbaa198eb8b588be029f38b00299caa2c"
integrity sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==
"@types/uuid@^8.3.4":
version "8.3.4"
resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.4.tgz#bd86a43617df0594787d38b735f55c805becf1bc"
integrity sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==
"@types/ws@^7.4.4":
version "7.4.7"
resolved "https://registry.yarnpkg.com/@types/ws/-/ws-7.4.7.tgz#f7c390a36f7a0679aa69de2d501319f4f8d9b702"
integrity sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==
dependencies:
"@types/node" "*"
"@types/ws@^8.2.2", "@types/ws@^8.5.3":
version "8.5.10"
resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.10.tgz#4acfb517970853fa6574a3a6886791d04a396787"
integrity sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==
dependencies:
"@types/node" "*"
"@typescript-eslint/eslint-plugin@5.62.0":
version "5.62.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz#aeef0328d172b9e37d9bab6dbc13b87ed88977db"
integrity sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==
dependencies:
"@eslint-community/regexpp" "^4.4.0"
"@typescript-eslint/scope-manager" "5.62.0"
"@typescript-eslint/type-utils" "5.62.0"
"@typescript-eslint/utils" "5.62.0"
debug "^4.3.4"
graphemer "^1.4.0"
ignore "^5.2.0"
natural-compare-lite "^1.4.0"
semver "^7.3.7"
tsutils "^3.21.0"
"@typescript-eslint/parser@4.33.0":
version "4.33.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.33.0.tgz#dfe797570d9694e560528d18eecad86c8c744899"
integrity sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA==
dependencies:
"@typescript-eslint/scope-manager" "4.33.0"
"@typescript-eslint/types" "4.33.0"
"@typescript-eslint/typescript-estree" "4.33.0"
debug "^4.3.1"
"@typescript-eslint/scope-manager@4.33.0":
version "4.33.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz#d38e49280d983e8772e29121cf8c6e9221f280a3"
integrity sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ==
dependencies:
"@typescript-eslint/types" "4.33.0"
"@typescript-eslint/visitor-keys" "4.33.0"
"@typescript-eslint/scope-manager@5.62.0":
version "5.62.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz#d9457ccc6a0b8d6b37d0eb252a23022478c5460c"
integrity sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==
dependencies:
"@typescript-eslint/types" "5.62.0"
"@typescript-eslint/visitor-keys" "5.62.0"
"@typescript-eslint/type-utils@5.62.0":
version "5.62.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz#286f0389c41681376cdad96b309cedd17d70346a"
integrity sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==
dependencies:
"@typescript-eslint/typescript-estree" "5.62.0"
"@typescript-eslint/utils" "5.62.0"
debug "^4.3.4"
tsutils "^3.21.0"
"@typescript-eslint/types@4.33.0":
version "4.33.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72"
integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ==
"@typescript-eslint/types@5.62.0":
version "5.62.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.62.0.tgz#258607e60effa309f067608931c3df6fed41fd2f"
integrity sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==
"@typescript-eslint/typescript-estree@4.33.0":
version "4.33.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz#0dfb51c2908f68c5c08d82aefeaf166a17c24609"
integrity sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA==
dependencies:
"@typescript-eslint/types" "4.33.0"
"@typescript-eslint/visitor-keys" "4.33.0"
debug "^4.3.1"
globby "^11.0.3"
is-glob "^4.0.1"
semver "^7.3.5"
tsutils "^3.21.0"
"@typescript-eslint/typescript-estree@5.62.0":
version "5.62.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz#7d17794b77fabcac615d6a48fb143330d962eb9b"
integrity sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==
dependencies:
"@typescript-eslint/types" "5.62.0"
"@typescript-eslint/visitor-keys" "5.62.0"
debug "^4.3.4"
globby "^11.1.0"
is-glob "^4.0.3"
semver "^7.3.7"
tsutils "^3.21.0"
"@typescript-eslint/utils@5.62.0":
version "5.62.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.62.0.tgz#141e809c71636e4a75daa39faed2fb5f4b10df86"
integrity sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==
dependencies:
"@eslint-community/eslint-utils" "^4.2.0"
"@types/json-schema" "^7.0.9"
"@types/semver" "^7.3.12"
"@typescript-eslint/scope-manager" "5.62.0"
"@typescript-eslint/types" "5.62.0"
"@typescript-eslint/typescript-estree" "5.62.0"
eslint-scope "^5.1.1"
semver "^7.3.7"
"@typescript-eslint/visitor-keys@4.33.0":
version "4.33.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz#2a22f77a41604289b7a186586e9ec48ca92ef1dd"
integrity sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg==
dependencies:
"@typescript-eslint/types" "4.33.0"
eslint-visitor-keys "^2.0.0"
"@typescript-eslint/visitor-keys@5.62.0":
version "5.62.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz#2174011917ce582875954ffe2f6912d5931e353e"
integrity sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==
dependencies:
"@typescript-eslint/types" "5.62.0"
eslint-visitor-keys "^3.3.0"
JSONStream@^1.3.5:
version "1.3.5"
resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0"
integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==
dependencies:
jsonparse "^1.2.0"
through ">=2.2.7 <3"
abstract-logging@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/abstract-logging/-/abstract-logging-2.0.1.tgz#6b0c371df212db7129b57d2e7fcf282b8bf1c839"
integrity sha512-2BjRTZxTPvheOvGbBslFSYOUkr+SjPtOnrLP33f+VIWLzezQpZcqVg7ja3L4dBXmzzgwT+a029jRx5PCi3JuiA==
acorn-jsx@^5.3.1:
version "5.3.2"
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937"
integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==
acorn-walk@^8.1.1:
version "8.3.0"
resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.0.tgz#2097665af50fd0cf7a2dfccd2b9368964e66540f"
integrity sha512-FS7hV565M5l1R08MXqo8odwMTB02C2UqzB17RVgu9EyuYFBqJZ3/ZY97sQD5FewVu1UyDFc1yztUDrAwT0EypA==
acorn@^7.4.0:
version "7.4.1"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa"
integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==
acorn@^8.4.1:
version "8.11.2"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.2.tgz#ca0d78b51895be5390a5903c5b3bdcdaf78ae40b"
integrity sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==
agentkeepalive@^4.2.1, agentkeepalive@^4.3.0, agentkeepalive@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.5.0.tgz#2673ad1389b3c418c5a20c5d7364f93ca04be923"
integrity sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==
dependencies:
humanize-ms "^1.2.1"
ajv@^6.10.0, ajv@^6.11.0, ajv@^6.12.4, ajv@^6.12.6:
version "6.12.6"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4"
integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==
dependencies:
fast-deep-equal "^3.1.1"
fast-json-stable-stringify "^2.0.0"
json-schema-traverse "^0.4.1"
uri-js "^4.2.2"
ajv@^8.0.1, ajv@^8.1.0:
version "8.12.0"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.12.0.tgz#d1a0527323e22f53562c567c00991577dfbe19d1"
integrity sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==
dependencies:
fast-deep-equal "^3.1.1"
json-schema-traverse "^1.0.0"
require-from-string "^2.0.2"
uri-js "^4.2.2"
anchor-bankrun@0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/anchor-bankrun/-/anchor-bankrun-0.3.0.tgz#3789fcecbc201a2334cff228b99cc0da8ef0167e"
integrity sha512-PYBW5fWX+iGicIS5MIM/omhk1tQPUc0ELAnI/IkLKQJ6d75De/CQRh8MF2bU/TgGyFi6zEel80wUe3uRol9RrQ==
ansi-colors@4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348"
integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==
ansi-colors@^4.1.1:
version "4.1.3"
resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b"
integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==
ansi-regex@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
ansi-styles@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==
dependencies:
color-convert "^1.9.0"
ansi-styles@^4.0.0, ansi-styles@^4.1.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
dependencies:
color-convert "^2.0.1"
ansicolors@^0.3.2, ansicolors@~0.3.2:
version "0.3.2"
resolved "https://registry.yarnpkg.com/ansicolors/-/ansicolors-0.3.2.tgz#665597de86a9ffe3aa9bfbe6cae5c6ea426b4979"
integrity sha512-QXu7BPrP29VllRxH8GwB7x5iX5qWKAAMLqKQGWTeLWVlNHNOpVMJ91dsxQAIWXpjuW5wqvxu3Jd/nRjrJ+0pqg==
anymatch@~3.1.2:
version "3.1.3"
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e"
integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==
dependencies:
normalize-path "^3.0.0"
picomatch "^2.0.4"
archy@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40"
integrity sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==
arg@^4.1.0:
version "4.1.3"
resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089"
integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==
argparse@^1.0.7:
version "1.0.10"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==
dependencies:
sprintf-js "~1.0.2"
argparse@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==
array-union@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d"
integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==
assert@^2.0.0, assert@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/assert/-/assert-2.1.0.tgz#6d92a238d05dc02e7427c881fb8be81c8448b2dd"
integrity sha512-eLHpSK/Y4nhMJ07gDaAzoX/XAKS8PSaojml3M0DM4JpV1LAi5JOJ/p6H/XWrl8L+DzVEvVCW1z3vWAaB9oTsQw==
dependencies:
call-bind "^1.0.2"
is-nan "^1.3.2"
object-is "^1.1.5"
object.assign "^4.1.4"
util "^0.12.5"
assertion-error@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b"
integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==
astral-regex@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31"
integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==
async-mutex@0.3.2:
version "0.3.2"
resolved "https://registry.yarnpkg.com/async-mutex/-/async-mutex-0.3.2.tgz#1485eda5bda1b0ec7c8df1ac2e815757ad1831df"
integrity sha512-HuTK7E7MT7jZEh1P9GtRW9+aTWiDWWi9InbZ5hjxrnRa39KS4BW04+xLBhYNS2aXhHUIKZSw3gj4Pn1pj+qGAA==
dependencies:
tslib "^2.3.1"
async@3.2.5, async@^3.2.3:
version "3.2.5"
resolved "https://registry.yarnpkg.com/async/-/async-3.2.5.tgz#ebd52a8fdaf7a2289a24df399f8d8485c8a46b66"
integrity sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==
asynckit@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==
atomic-sleep@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/atomic-sleep/-/atomic-sleep-1.0.0.tgz#eb85b77a601fc932cfe432c5acd364a9e2c9075b"
integrity sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==
available-typed-arrays@^1.0.7:
version "1.0.7"
resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz#a5cc375d6a03c2efc87a553f3e0b1522def14846"
integrity sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==
dependencies:
possible-typed-array-names "^1.0.0"
avvio@^7.1.2:
version "7.2.5"
resolved "https://registry.yarnpkg.com/avvio/-/avvio-7.2.5.tgz#65ba255f10b0bea7ac6eded71a5344cd88f5de19"
integrity sha512-AOhBxyLVdpOad3TujtC9kL/9r3HnTkxwQ5ggOsYrvvZP1cCFvzHWJd5XxZDFuTn+IN8vkKSG5SEJrd27vCSbeA==
dependencies:
archy "^1.0.0"
debug "^4.0.0"
fastq "^1.6.1"
queue-microtask "^1.1.2"
aws-sdk@2.1511.0:
version "2.1511.0"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.1511.0.tgz#9a8acfe2006c5acd364790f73220d9015d8349b8"
integrity sha512-LikcMeIzA1fu+j8qElVmPDpWBFsMzd8pwQoo33xXhIwtWaMoaBMI5vGGz/cvdn3LnjkRcEntWZeE8haULsy+bA==
dependencies:
buffer "4.9.2"
events "1.1.1"
ieee754 "1.1.13"
jmespath "0.16.0"
querystring "0.2.0"
sax "1.2.1"
url "0.10.3"
util "^0.12.4"
uuid "8.0.0"
xml2js "0.5.0"
axios-retry@^3.8.0:
version "3.9.1"
resolved "https://registry.yarnpkg.com/axios-retry/-/axios-retry-3.9.1.tgz#c8924a8781c8e0a2c5244abf773deb7566b3830d"
integrity sha512-8PJDLJv7qTTMMwdnbMvrLYuvB47M81wRtxQmEdV5w4rgbTXTt+vtPkXwajOfOdSyv/wZICJOC+/UhXH4aQ/R+w==
dependencies:
"@babel/runtime" "^7.15.4"
is-retry-allowed "^2.2.0"
axios@1.7.7:
version "1.7.7"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.7.7.tgz#2f554296f9892a72ac8d8e4c5b79c14a91d0a47f"
integrity sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==
dependencies:
follow-redirects "^1.15.6"
form-data "^4.0.0"
proxy-from-env "^1.1.0"
axios@^1.5.1, axios@^1.7.2:
version "1.7.2"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.7.2.tgz#b625db8a7051fbea61c35a3cbb3a1daa7b9c7621"
integrity sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==
dependencies:
follow-redirects "^1.15.6"
form-data "^4.0.0"
proxy-from-env "^1.1.0"
axios@^1.7.4:
version "1.7.4"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.7.4.tgz#4c8ded1b43683c8dd362973c393f3ede24052aa2"
integrity sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==
dependencies:
follow-redirects "^1.15.6"
form-data "^4.0.0"
proxy-from-env "^1.1.0"
balanced-match@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
base-x@^3.0.2:
version "3.0.9"
resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.9.tgz#6349aaabb58526332de9f60995e548a53fe21320"
integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==
dependencies:
safe-buffer "^5.0.1"
base-x@^3.0.6:
version "3.0.10"
resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.10.tgz#62de58653f8762b5d6f8d9fe30fa75f7b2585a75"
integrity sha512-7d0s06rR9rYaIWHkpfLIFICM/tkSVdoPC9qYAQRpxn9DdKNWNsKC0uk++akckyLq16Tx2WIinnZ6WRriAt6njQ==
dependencies:
safe-buffer "^5.0.1"
base-x@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/base-x/-/base-x-4.0.0.tgz#d0e3b7753450c73f8ad2389b5c018a4af7b2224a"
integrity sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==
base-x@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/base-x/-/base-x-5.0.0.tgz#6d835ceae379130e1a4cb846a70ac4746f28ea9b"
integrity sha512-sMW3VGSX1QWVFA6l8U62MLKz29rRfpTlYdCqLdpLo1/Yd4zZwSbnUaDfciIAowAqvq7YFnWq9hrhdg1KYgc1lQ==
base64-js@^1.0.2, base64-js@^1.3.1, base64-js@^1.5.1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"
integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==
big.js@^6.2.1:
version "6.2.1"
resolved "https://registry.yarnpkg.com/big.js/-/big.js-6.2.1.tgz#7205ce763efb17c2e41f26f121c420c6a7c2744f"
integrity sha512-bCtHMwL9LeDIozFn+oNhhFoq+yQ3BNdnsLSASUxLciOb1vgvpHsIO1dsENiGMgbb4SkP5TrzWzRiLddn8ahVOQ==
bigint-buffer@^1.1.5:
version "1.1.5"
resolved "https://registry.yarnpkg.com/bigint-buffer/-/bigint-buffer-1.1.5.tgz#d038f31c8e4534c1f8d0015209bf34b4fa6dd442"
integrity sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==
dependencies:
bindings "^1.3.0"
bignumber.js@^9.0.1:
version "9.1.2"
resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.2.tgz#b7c4242259c008903b13707983b5f4bbd31eda0c"
integrity sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==
binary-extensions@^2.0.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d"
integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==
bindings@^1.3.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df"
integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==
dependencies:
file-uri-to-path "1.0.0"
bn.js@^5.0.0, bn.js@^5.1.0, bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1:
version "5.2.1"
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70"
integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==
borsh@^0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/borsh/-/borsh-0.7.0.tgz#6e9560d719d86d90dc589bca60ffc8a6c51fec2a"
integrity sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==
dependencies:
bn.js "^5.2.0"
bs58 "^4.0.0"
text-encoding-utf-8 "^1.0.2"
brace-expansion@^1.1.7:
version "1.1.11"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
dependencies:
balanced-match "^1.0.0"
concat-map "0.0.1"
brace-expansion@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae"
integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==
dependencies:
balanced-match "^1.0.0"
braces@^3.0.2, braces@~3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==
dependencies:
fill-range "^7.0.1"
browser-stdout@1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60"
integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==
bs58@^4.0.0, bs58@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a"
integrity sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==
dependencies:
base-x "^3.0.2"
bs58@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/bs58/-/bs58-5.0.0.tgz#865575b4d13c09ea2a84622df6c8cbeb54ffc279"
integrity sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==
dependencies:
base-x "^4.0.0"
bs58@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/bs58/-/bs58-6.0.0.tgz#a2cda0130558535dd281a2f8697df79caaf425d8"
integrity sha512-PD0wEnEYg6ijszw/u8s+iI3H17cTymlrwkKhDhPZq+Sokl3AU4htyBFTjAeNAlCCmg0f53g6ih3jATyCKftTfw==
dependencies:
base-x "^5.0.0"
bson@*:
version "6.2.0"
resolved "https://registry.yarnpkg.com/bson/-/bson-6.2.0.tgz#4b6acafc266ba18eeee111373c2699304a9ba0a3"
integrity sha512-ID1cI+7bazPDyL9wYy9GaQ8gEEohWvcUl/Yf0dIdutJxnmInEEyCsb4awy/OiBfall7zBA179Pahi3vCdFze3Q==
buffer-layout@^1.2.0, buffer-layout@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/buffer-layout/-/buffer-layout-1.2.2.tgz#b9814e7c7235783085f9ca4966a0cfff112259d5"
integrity sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA==
buffer@4.9.2:
version "4.9.2"
resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.2.tgz#230ead344002988644841ab0244af8c44bbe3ef8"
integrity sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==
dependencies:
base64-js "^1.0.2"
ieee754 "^1.1.4"
isarray "^1.0.0"
buffer@6.0.3, buffer@^6.0.1, buffer@^6.0.3, buffer@~6.0.3:
version "6.0.3"
resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6"
integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==
dependencies:
base64-js "^1.3.1"
ieee754 "^1.2.1"
bufferutil@^4.0.1:
version "4.0.8"
resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.8.tgz#1de6a71092d65d7766c4d8a522b261a6e787e8ea"
integrity sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==
dependencies:
node-gyp-build "^4.3.0"
call-bind@^1.0.0, call-bind@^1.0.2, call-bind@^1.0.5, call-bind@^1.0.7:
version "1.0.7"
resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.7.tgz#06016599c40c56498c18769d2730be242b6fa3b9"
integrity sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==
dependencies:
es-define-property "^1.0.0"
es-errors "^1.3.0"
function-bind "^1.1.2"
get-intrinsic "^1.2.4"
set-function-length "^1.2.1"
callsites@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73"
integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==
camelcase@^5.3.1:
version "5.3.1"
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320"
integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==
camelcase@^6.0.0, camelcase@^6.2.1, camelcase@^6.3.0:
version "6.3.0"
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a"
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==
chai@4.3.10:
version "4.3.10"
resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.10.tgz#d784cec635e3b7e2ffb66446a63b4e33bd390384"
integrity sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g==
dependencies:
assertion-error "^1.1.0"
check-error "^1.0.3"
deep-eql "^4.1.3"
get-func-name "^2.0.2"
loupe "^2.3.6"
pathval "^1.1.1"
type-detect "^4.0.8"
chalk@^2.4.2:
version "2.4.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
dependencies:
ansi-styles "^3.2.1"
escape-string-regexp "^1.0.5"
supports-color "^5.3.0"
chalk@^4.0.0, chalk@^4.1.0:
version "4.1.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==
dependencies:
ansi-styles "^4.1.0"
supports-color "^7.1.0"
chalk@^5.3.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.3.0.tgz#67c20a7ebef70e7f3970a01f90fa210cb6860385"
integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==
check-error@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.3.tgz#a6502e4312a7ee969f646e83bb3ddd56281bd694"
integrity sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==
dependencies:
get-func-name "^2.0.2"
chokidar@3.5.3:
version "3.5.3"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd"
integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==
dependencies:
anymatch "~3.1.2"
braces "~3.0.2"
glob-parent "~5.1.2"
is-binary-path "~2.1.0"
is-glob "~4.0.1"
normalize-path "~3.0.0"
readdirp "~3.6.0"
optionalDependencies:
fsevents "~2.3.2"
cliui@^7.0.2:
version "7.0.4"
resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f"
integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==
dependencies:
string-width "^4.2.0"
strip-ansi "^6.0.0"
wrap-ansi "^7.0.0"
cliui@^8.0.1:
version "8.0.1"
resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa"
integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==
dependencies:
string-width "^4.2.0"
strip-ansi "^6.0.1"
wrap-ansi "^7.0.0"
clone@2.x:
version "2.1.2"
resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f"
integrity sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==
color-convert@^1.9.0, color-convert@^1.9.3:
version "1.9.3"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==
dependencies:
color-name "1.1.3"
color-convert@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
dependencies:
color-name "~1.1.4"
color-name@1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==
color-name@^1.0.0, color-name@~1.1.4:
version "1.1.4"
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
color-string@^1.6.0:
version "1.9.1"
resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.9.1.tgz#4467f9146f036f855b764dfb5bf8582bf342c7a4"
integrity sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==
dependencies:
color-name "^1.0.0"
simple-swizzle "^0.2.2"
color@^3.1.3:
version "3.2.1"
resolved "https://registry.yarnpkg.com/color/-/color-3.2.1.tgz#3544dc198caf4490c3ecc9a790b54fe9ff45e164"
integrity sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==
dependencies:
color-convert "^1.9.3"
color-string "^1.6.0"
colorspace@1.1.x:
version "1.1.4"
resolved "https://registry.yarnpkg.com/colorspace/-/colorspace-1.1.4.tgz#8d442d1186152f60453bf8070cd66eb364e59243"
integrity sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==
dependencies:
color "^3.1.3"
text-hex "1.0.x"
combined-stream@^1.0.8:
version "1.0.8"
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==
dependencies:
delayed-stream "~1.0.0"
commander@9.5.0:
version "9.5.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-9.5.0.tgz#bc08d1eb5cedf7ccb797a96199d41c7bc3e60d30"
integrity sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==
commander@^12.0.0, commander@^12.1.0:
version "12.1.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-12.1.0.tgz#01423b36f501259fdaac4d0e4d60c96c991585d3"
integrity sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==
commander@^2.20.3:
version "2.20.3"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==
commander@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae"
integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==
concat-map@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
cookie@^0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b"
integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==
create-require@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333"
integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==
cron-validator@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/cron-validator/-/cron-validator-1.3.1.tgz#8f2fe430f92140df77f91178ae31fc1e3a48a20e"
integrity sha512-C1HsxuPCY/5opR55G5/WNzyEGDWFVG+6GLrA+fW/sCTcP6A6NTjUP2AK7B8n2PyFs90kDG2qzwm8LMheADku6A==
cross-fetch@^3.1.5:
version "3.1.8"
resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.8.tgz#0327eba65fd68a7d119f8fb2bf9334a1a7956f82"
integrity sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==
dependencies:
node-fetch "^2.6.12"
cross-spawn@^7.0.2:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
dependencies:
path-key "^3.1.0"
shebang-command "^2.0.0"
which "^2.0.1"
crypto-hash@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/crypto-hash/-/crypto-hash-1.3.0.tgz#b402cb08f4529e9f4f09346c3e275942f845e247"
integrity sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg==
debug@4.3.4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.1, debug@^4.3.1, debug@^4.3.3, debug@^4.3.4:
version "4.3.4"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
dependencies:
ms "2.1.2"
decamelize@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837"
integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==
decimal.js@^10.4.0, decimal.js@^10.4.3:
version "10.4.3"
resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23"
integrity sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==
deep-eql@^4.1.3:
version "4.1.3"
resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.1.3.tgz#7c7775513092f7df98d8df9996dd085eb668cc6d"
integrity sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==
dependencies:
type-detect "^4.0.0"
deep-is@^0.1.3:
version "0.1.4"
resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831"
integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==
deepmerge@^4.2.2:
version "4.3.1"
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a"
integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==
define-data-property@^1.0.1, define-data-property@^1.1.4:
version "1.1.4"
resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e"
integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==
dependencies:
es-define-property "^1.0.0"
es-errors "^1.3.0"
gopd "^1.0.1"
define-properties@^1.1.3, define-properties@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c"
integrity sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==
dependencies:
define-data-property "^1.0.1"
has-property-descriptors "^1.0.0"
object-keys "^1.1.1"
delay@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/delay/-/delay-5.0.0.tgz#137045ef1b96e5071060dd5be60bf9334436bd1d"
integrity sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==
delayed-stream@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==
diff@5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b"
integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==
diff@^4.0.1:
version "4.0.2"
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==
dir-glob@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f"
integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==
dependencies:
path-type "^4.0.0"
doctrine@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961"
integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==
dependencies:
esutils "^2.0.2"
dot-case@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-3.0.4.tgz#9b2b670d00a431667a8a75ba29cd1b98809ce751"
integrity sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==
dependencies:
no-case "^3.0.4"
tslib "^2.0.3"
dotenv@10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81"
integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==
dotenv@^16.0.3:
version "16.3.1"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.3.1.tgz#369034de7d7e5b120972693352a3bf112172cc3e"
integrity sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==
duplexify@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-4.1.2.tgz#18b4f8d28289132fa0b9573c898d9f903f81c7b0"
integrity sha512-fz3OjcNCHmRP12MJoZMPglx8m4rrFP8rovnk4vT8Fs+aonZoCwGg10dSsQsfP/E62eZcPTMSMP6686fu9Qlqtw==
dependencies:
end-of-stream "^1.4.1"
inherits "^2.0.3"
readable-stream "^3.1.1"
stream-shift "^1.0.0"
emoji-regex@^8.0.0:
version "8.0.0"
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
enabled@2.0.x:
version "2.0.0"
resolved "https://registry.yarnpkg.com/enabled/-/enabled-2.0.0.tgz#f9dd92ec2d6f4bbc0d5d1e64e21d61cd4665e7c2"
integrity sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==
end-of-stream@^1.4.1:
version "1.4.4"
resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0"
integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==
dependencies:
once "^1.4.0"
enquirer@^2.3.5:
version "2.4.1"
resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.4.1.tgz#93334b3fbd74fc7097b224ab4a8fb7e40bf4ae56"
integrity sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==
dependencies:
ansi-colors "^4.1.1"
strip-ansi "^6.0.1"
es-define-property@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.0.tgz#c7faefbdff8b2696cf5f46921edfb77cc4ba3845"
integrity sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==
dependencies:
get-intrinsic "^1.2.4"
es-errors@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f"
integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==
es6-promise@^4.0.3:
version "4.2.8"
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a"
integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==
es6-promisify@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203"
integrity sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==
dependencies:
es6-promise "^4.0.3"
escalade@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==
escape-string-regexp@4.0.0, escape-string-regexp@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
escape-string-regexp@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==
eslint-config-prettier@8.10.0:
version "8.10.0"
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.10.0.tgz#3a06a662130807e2502fc3ff8b4143d8a0658e11"
integrity sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==
eslint-plugin-prettier@3.4.1:
version "3.4.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.1.tgz#e9ddb200efb6f3d05ffe83b1665a716af4a387e5"
integrity sha512-htg25EUYUeIhKHXjOinK4BgCcDwtLHjqaxCDsMy5nbnUMkKFvIhMVCp+5GFUXQ4Nr8lBsPqtGAqBenbpFqAA2g==
dependencies:
prettier-linter-helpers "^1.0.0"
eslint-scope@^5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c"
integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==
dependencies:
esrecurse "^4.3.0"
estraverse "^4.1.1"
eslint-utils@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27"
integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==
dependencies:
eslint-visitor-keys "^1.1.0"
eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e"
integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==
eslint-visitor-keys@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303"
integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==
eslint-visitor-keys@^3.3.0:
version "3.4.3"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800"
integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==
eslint@7.32.0:
version "7.32.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d"
integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==
dependencies:
"@babel/code-frame" "7.12.11"
"@eslint/eslintrc" "^0.4.3"
"@humanwhocodes/config-array" "^0.5.0"
ajv "^6.10.0"
chalk "^4.0.0"
cross-spawn "^7.0.2"
debug "^4.0.1"
doctrine "^3.0.0"
enquirer "^2.3.5"
escape-string-regexp "^4.0.0"
eslint-scope "^5.1.1"
eslint-utils "^2.1.0"
eslint-visitor-keys "^2.0.0"
espree "^7.3.1"
esquery "^1.4.0"
esutils "^2.0.2"
fast-deep-equal "^3.1.3"
file-entry-cache "^6.0.1"
functional-red-black-tree "^1.0.1"
glob-parent "^5.1.2"
globals "^13.6.0"
ignore "^4.0.6"
import-fresh "^3.0.0"
imurmurhash "^0.1.4"
is-glob "^4.0.0"
js-yaml "^3.13.1"
json-stable-stringify-without-jsonify "^1.0.1"
levn "^0.4.1"
lodash.merge "^4.6.2"
minimatch "^3.0.4"
natural-compare "^1.4.0"
optionator "^0.9.1"
progress "^2.0.0"
regexpp "^3.1.0"
semver "^7.2.1"
strip-ansi "^6.0.0"
strip-json-comments "^3.1.0"
table "^6.0.9"
text-table "^0.2.0"
v8-compile-cache "^2.0.3"
espree@^7.3.0, espree@^7.3.1:
version "7.3.1"
resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6"
integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==
dependencies:
acorn "^7.4.0"
acorn-jsx "^5.3.1"
eslint-visitor-keys "^1.3.0"
esprima@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==
esquery@^1.4.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b"
integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==
dependencies:
estraverse "^5.1.0"
esrecurse@^4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921"
integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==
dependencies:
estraverse "^5.2.0"
estraverse@^4.1.1:
version "4.3.0"
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d"
integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==
estraverse@^5.1.0, estraverse@^5.2.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123"
integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==
esutils@^2.0.2:
version "2.0.3"
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64"
integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==
eventemitter3@^4.0.7:
version "4.0.7"
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f"
integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==
eventemitter3@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-5.0.1.tgz#53f5ffd0a492ac800721bb42c66b841de96423c4"
integrity sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==
events@1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924"
integrity sha512-kEcvvCBByWXGnZy6JUlgAp2gBIUjfCAV6P6TgT1/aaQKcmuAEC4OZTV1I4EWQLz2gxZw76atuVyvHhTxvi0Flw==
eyes@^0.1.8:
version "0.1.8"
resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0"
integrity sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ==
fast-content-type-parse@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/fast-content-type-parse/-/fast-content-type-parse-1.1.0.tgz#4087162bf5af3294d4726ff29b334f72e3a1092c"
integrity sha512-fBHHqSTFLVnR61C+gltJuE5GkVQMV0S2nqUO8TJ+5Z3qAKG8vAx4FKai1s5jq/inV1+sREynIWSuQ6HgoSXpDQ==
fast-decode-uri-component@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/fast-decode-uri-component/-/fast-decode-uri-component-1.0.1.tgz#46f8b6c22b30ff7a81357d4f59abfae938202543"
integrity sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg==
fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
version "3.1.3"
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==
fast-diff@^1.1.2:
version "1.3.0"
resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.3.0.tgz#ece407fa550a64d638536cd727e129c61616e0f0"
integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==
fast-glob@^3.2.9:
version "3.3.2"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129"
integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==
dependencies:
"@nodelib/fs.stat" "^2.0.2"
"@nodelib/fs.walk" "^1.2.3"
glob-parent "^5.1.2"
merge2 "^1.3.0"
micromatch "^4.0.4"
fast-json-stable-stringify@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633"
integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==
fast-json-stringify@^2.5.2:
version "2.7.13"
resolved "https://registry.yarnpkg.com/fast-json-stringify/-/fast-json-stringify-2.7.13.tgz#277aa86c2acba4d9851bd6108ed657aa327ed8c0"
integrity sha512-ar+hQ4+OIurUGjSJD1anvYSDcUflywhKjfxnsW4TBTD7+u0tJufv6DKRWoQk3vI6YBOWMoz0TQtfbe7dxbQmvA==
dependencies:
ajv "^6.11.0"
deepmerge "^4.2.2"
rfdc "^1.2.0"
string-similarity "^4.0.1"
fast-levenshtein@^2.0.6:
version "2.0.6"
resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==
fast-redact@^3.0.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/fast-redact/-/fast-redact-3.3.0.tgz#7c83ce3a7be4898241a46560d51de10f653f7634"
integrity sha512-6T5V1QK1u4oF+ATxs1lWUmlEk6P2T9HqJG3e2DnHOdVgZy2rFJBoEnrIedcTXlkAHU/zKC+7KETJ+KGGKwxgMQ==
fast-safe-stringify@^2.0.8:
version "2.1.1"
resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz#c406a83b6e70d9e35ce3b30a81141df30aeba884"
integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==
fast-stable-stringify@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fast-stable-stringify/-/fast-stable-stringify-1.0.0.tgz#5c5543462b22aeeefd36d05b34e51c78cb86d313"
integrity sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag==
fastify@^3.19.2:
version "3.29.5"
resolved "https://registry.yarnpkg.com/fastify/-/fastify-3.29.5.tgz#a219af4223c6071eef46f3b98aee3f39f47a8c88"
integrity sha512-FBDgb1gkenZxxh4sTD6AdI6mFnZnsgckpjIXzIvfLSYCa4isfQeD8QWGPib63dxq6btnY0l1j8I0xYhMvUb+sw==
dependencies:
"@fastify/ajv-compiler" "^1.0.0"
"@fastify/error" "^2.0.0"
abstract-logging "^2.0.0"
avvio "^7.1.2"
fast-content-type-parse "^1.0.0"
fast-json-stringify "^2.5.2"
find-my-way "^4.5.0"
flatstr "^1.0.12"
light-my-request "^4.2.0"
pino "^6.13.0"
process-warning "^1.0.0"
proxy-addr "^2.0.7"
rfdc "^1.1.4"
secure-json-parse "^2.0.0"
semver "^7.3.2"
tiny-lru "^8.0.1"
fastq@^1.6.0, fastq@^1.6.1:
version "1.15.0"
resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.15.0.tgz#d04d07c6a2a68fe4599fea8d2e103a937fae6b3a"
integrity sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==
dependencies:
reusify "^1.0.4"
fecha@^4.2.0:
version "4.2.3"
resolved "https://registry.yarnpkg.com/fecha/-/fecha-4.2.3.tgz#4d9ccdbc61e8629b259fdca67e65891448d569fd"
integrity sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==
file-entry-cache@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027"
integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==
dependencies:
flat-cache "^3.0.4"
file-uri-to-path@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd"
integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==
fill-range@^7.0.1:
version "7.0.1"
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==
dependencies:
to-regex-range "^5.0.1"
find-my-way@^4.5.0:
version "4.5.1"
resolved "https://registry.yarnpkg.com/find-my-way/-/find-my-way-4.5.1.tgz#758e959194b90aea0270db18fff75e2fceb2239f"
integrity sha512-kE0u7sGoUFbMXcOG/xpkmz4sRLCklERnBcg7Ftuu1iAxsfEt2S46RLJ3Sq7vshsEy2wJT2hZxE58XZK27qa8kg==
dependencies:
fast-decode-uri-component "^1.0.1"
fast-deep-equal "^3.1.3"
safe-regex2 "^2.0.0"
semver-store "^0.3.0"
find-process@^1.4.7:
version "1.4.7"
resolved "https://registry.yarnpkg.com/find-process/-/find-process-1.4.7.tgz#8c76962259216c381ef1099371465b5b439ea121"
integrity sha512-/U4CYp1214Xrp3u3Fqr9yNynUrr5Le4y0SsJh2lMDDSbpwYSz3M2SMWQC+wqcx79cN8PQtHQIL8KnuY9M66fdg==
dependencies:
chalk "^4.0.0"
commander "^5.1.0"
debug "^4.1.1"
find-up@5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc"
integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==
dependencies:
locate-path "^6.0.0"
path-exists "^4.0.0"
find@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/find/-/find-0.3.0.tgz#4082e8fc8d8320f1a382b5e4f521b9bc50775cb8"
integrity sha512-iSd+O4OEYV/I36Zl8MdYJO0xD82wH528SaCieTVHhclgiYNe9y+yPKSwK+A7/WsmHL1EZ+pYUJBXWTL5qofksw==
dependencies:
traverse-chain "~0.1.0"
flat-cache@^3.0.4:
version "3.2.0"
resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.2.0.tgz#2c0c2d5040c99b1632771a9d105725c0115363ee"
integrity sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==
dependencies:
flatted "^3.2.9"
keyv "^4.5.3"
rimraf "^3.0.2"
flat@^5.0.2:
version "5.0.2"
resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241"
integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==
flatstr@^1.0.12:
version "1.0.12"
resolved "https://registry.yarnpkg.com/flatstr/-/flatstr-1.0.12.tgz#c2ba6a08173edbb6c9640e3055b95e287ceb5931"
integrity sha512-4zPxDyhCyiN2wIAtSLI6gc82/EjqZc1onI4Mz/l0pWrAlsSfYH/2ZIcU+e3oA2wDwbzIWNKwa23F8rh6+DRWkw==
flatted@^3.2.9:
version "3.2.9"
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.9.tgz#7eb4c67ca1ba34232ca9d2d93e9886e611ad7daf"
integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==
fn.name@1.x.x:
version "1.1.0"
resolved "https://registry.yarnpkg.com/fn.name/-/fn.name-1.1.0.tgz#26cad8017967aea8731bc42961d04a3d5988accc"
integrity sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==
follow-redirects@^1.15.6:
version "1.15.6"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b"
integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==
for-each@^0.3.3:
version "0.3.3"
resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e"
integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==
dependencies:
is-callable "^1.1.3"
form-data@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452"
integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==
dependencies:
asynckit "^0.4.0"
combined-stream "^1.0.8"
mime-types "^2.1.12"
forwarded@0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811"
integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==
fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==
fsevents@~2.3.2:
version "2.3.3"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==
function-bind@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c"
integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==
functional-red-black-tree@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327"
integrity sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==
generic-pool@*:
version "3.9.0"
resolved "https://registry.yarnpkg.com/generic-pool/-/generic-pool-3.9.0.tgz#36f4a678e963f4fdb8707eab050823abc4e8f5e4"
integrity sha512-hymDOu5B53XvN4QT9dBmZxPX4CWhBPPLguTZ9MMFeFa/Kg0xWVfylOVNlJji/E7yTZWFd/q9GO5TxDLq156D7g==
get-caller-file@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
get-func-name@^2.0.1, get-func-name@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.2.tgz#0d7cf20cd13fda808669ffa88f4ffc7a3943fc41"
integrity sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==
get-intrinsic@^1.1.3, get-intrinsic@^1.2.4:
version "1.2.4"
resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.4.tgz#e385f5a4b5227d449c3eabbad05494ef0abbeadd"
integrity sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==
dependencies:
es-errors "^1.3.0"
function-bind "^1.1.2"
has-proto "^1.0.1"
has-symbols "^1.0.3"
hasown "^2.0.0"
glob-parent@^5.1.2, glob-parent@~5.1.2:
version "5.1.2"
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==
dependencies:
is-glob "^4.0.1"
glob@7.2.0:
version "7.2.0"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023"
integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
minimatch "^3.0.4"
once "^1.3.0"
path-is-absolute "^1.0.0"
glob@^7.1.3:
version "7.2.3"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"
integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
minimatch "^3.1.1"
once "^1.3.0"
path-is-absolute "^1.0.0"
globals@^13.6.0, globals@^13.9.0:
version "13.23.0"
resolved "https://registry.yarnpkg.com/globals/-/globals-13.23.0.tgz#ef31673c926a0976e1f61dab4dca57e0c0a8af02"
integrity sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==
dependencies:
type-fest "^0.20.2"
globby@^11.0.3, globby@^11.1.0:
version "11.1.0"
resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b"
integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==
dependencies:
array-union "^2.1.0"
dir-glob "^3.0.1"
fast-glob "^3.2.9"
ignore "^5.2.0"
merge2 "^1.4.1"
slash "^3.0.0"
gopd@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c"
integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==
dependencies:
get-intrinsic "^1.1.3"
graphemer@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6"
integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==
graphql@^15.5.1:
version "15.8.0"
resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.8.0.tgz#33410e96b012fa3bdb1091cc99a94769db212b38"
integrity sha512-5gghUc24tP9HRznNpV2+FIoq3xKkj5dTQqf4v0CpdPbFVwFkWoxOM+o+2OC9ZSvjEMTjfmG9QT+gcvggTwW1zw==
has-flag@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==
has-flag@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
has-property-descriptors@^1.0.0, has-property-descriptors@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854"
integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==
dependencies:
es-define-property "^1.0.0"
has-proto@^1.0.1:
version "1.0.3"
resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.3.tgz#b31ddfe9b0e6e9914536a6ab286426d0214f77fd"
integrity sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==
has-symbols@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8"
integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==
has-tostringtag@^1.0.0, has-tostringtag@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz#2cdc42d40bef2e5b4eeab7c01a73c54ce7ab5abc"
integrity sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==
dependencies:
has-symbols "^1.0.3"
hasown@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003"
integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==
dependencies:
function-bind "^1.1.2"
he@1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==
humanize-ms@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed"
integrity sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==
dependencies:
ms "^2.0.0"
husky@7.0.4:
version "7.0.4"
resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.4.tgz#242048245dc49c8fb1bf0cc7cfb98dd722531535"
integrity sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==
ieee754@1.1.13:
version "1.1.13"
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84"
integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==
ieee754@^1.1.4, ieee754@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352"
integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==
ignore@^4.0.6:
version "4.0.6"
resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc"
integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==
ignore@^5.2.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.0.tgz#67418ae40d34d6999c95ff56016759c718c82f78"
integrity sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==
import-fresh@^3.0.0, import-fresh@^3.2.1:
version "3.3.0"
resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b"
integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==
dependencies:
parent-module "^1.0.0"
resolve-from "^4.0.0"
imurmurhash@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==
inflight@^1.0.4:
version "1.0.6"
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==
dependencies:
once "^1.3.0"
wrappy "1"
inherits@2, inherits@^2.0.3:
version "2.0.4"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
ipaddr.js@1.9.1:
version "1.9.1"
resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3"
integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==
is-arguments@^1.0.4:
version "1.1.1"
resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b"
integrity sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==
dependencies:
call-bind "^1.0.2"
has-tostringtag "^1.0.0"
is-arrayish@^0.3.1:
version "0.3.2"
resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.3.2.tgz#4574a2ae56f7ab206896fb431eaeed066fdf8f03"
integrity sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==
is-binary-path@~2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09"
integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==
dependencies:
binary-extensions "^2.0.0"
is-callable@^1.1.3:
version "1.2.7"
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055"
integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==
is-core-module@^2.13.0:
version "2.13.1"
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.1.tgz#ad0d7532c6fea9da1ebdc82742d74525c6273384"
integrity sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==
dependencies:
hasown "^2.0.0"
is-extglob@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==
is-fullwidth-code-point@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==
is-generator-function@^1.0.7:
version "1.0.10"
resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.10.tgz#f1558baf1ac17e0deea7c0415c438351ff2b3c72"
integrity sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==
dependencies:
has-tostringtag "^1.0.0"
is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1:
version "4.0.3"
resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084"
integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==
dependencies:
is-extglob "^2.1.1"
is-nan@^1.3.2:
version "1.3.2"
resolved "https://registry.yarnpkg.com/is-nan/-/is-nan-1.3.2.tgz#043a54adea31748b55b6cd4e09aadafa69bd9e1d"
integrity sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==
dependencies:
call-bind "^1.0.0"
define-properties "^1.1.3"
is-number@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==
is-plain-obj@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287"
integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==
is-retry-allowed@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-2.2.0.tgz#88f34cbd236e043e71b6932d09b0c65fb7b4d71d"
integrity sha512-XVm7LOeLpTW4jV19QSH38vkswxoLud8sQ57YwJVTPWdiaI9I8keEhGFpBlslyVsgdQy4Opg8QOLb8YRgsyZiQg==
is-stream@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077"
integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==
is-typed-array@^1.1.3:
version "1.1.13"
resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.13.tgz#d6c5ca56df62334959322d7d7dd1cca50debe229"
integrity sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==
dependencies:
which-typed-array "^1.1.14"
is-unicode-supported@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7"
integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==
isarray@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==
isexe@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==
isomorphic-ws@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz#55fd4cd6c5e6491e76dc125938dd863f5cd4f2dc"
integrity sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==
jayson@^4.0.0, jayson@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/jayson/-/jayson-4.1.0.tgz#60dc946a85197317f2b1439d672a8b0a99cea2f9"
integrity sha512-R6JlbyLN53Mjku329XoRT2zJAE6ZgOQ8f91ucYdMCD4nkGCF9kZSrcGXpHIU4jeKj58zUZke2p+cdQchU7Ly7A==
dependencies:
"@types/connect" "^3.4.33"
"@types/node" "^12.12.54"
"@types/ws" "^7.4.4"
JSONStream "^1.3.5"
commander "^2.20.3"
delay "^5.0.0"
es6-promisify "^5.0.0"
eyes "^0.1.8"
isomorphic-ws "^4.0.1"
json-stringify-safe "^5.0.1"
uuid "^8.3.2"
ws "^7.4.5"
jayson@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/jayson/-/jayson-4.1.1.tgz#282ff13d3cea09776db684b7eeca98c47b2fa99a"
integrity sha512-5ZWm4Q/0DHPyeMfAsrwViwUS2DMVsQgWh8bEEIVTkfb3DzHZ2L3G5WUnF+AKmGjjM9r1uAv73SaqC1/U4RL45w==
dependencies:
"@types/connect" "^3.4.33"
"@types/node" "^12.12.54"
"@types/ws" "^7.4.4"
JSONStream "^1.3.5"
commander "^2.20.3"
delay "^5.0.0"
es6-promisify "^5.0.0"
eyes "^0.1.8"
isomorphic-ws "^4.0.1"
json-stringify-safe "^5.0.1"
uuid "^8.3.2"
ws "^7.5.10"
jito-ts@4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/jito-ts/-/jito-ts-4.1.1.tgz#b7ba0941102ad346b8b499e631a6a64779ab7958"
integrity sha512-5a/z7AvtitpExcyxYh1RhPoWRfCA4IPopE5hM5Cxw7/zHnV+VBNZL0m4t3fjfPgMnmPkeoTx2xTw+mSD4PDG7w==
dependencies:
"@grpc/grpc-js" "^1.8.13"
"@noble/ed25519" "^1.7.1"
"@solana/web3.js" "~1.77.3"
"@types/bs58" "^4.0.4"
agentkeepalive "^4.3.0"
bs58 "^6.0.0"
dotenv "^16.0.3"
jayson "^4.0.0"
node-fetch "^2.6.7"
superstruct "^1.0.3"
jito-ts@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/jito-ts/-/jito-ts-3.0.1.tgz#24126389896e042c26d303c4e802064b249ed27e"
integrity sha512-TSofF7KqcwyaWGjPaSYC8RDoNBY1TPRNBHdrw24bdIi7mQ5bFEDdYK3D//llw/ml8YDvcZlgd644WxhjLTS9yg==
dependencies:
"@grpc/grpc-js" "^1.8.13"
"@noble/ed25519" "^1.7.1"
"@solana/web3.js" "~1.77.3"
agentkeepalive "^4.3.0"
dotenv "^16.0.3"
jayson "^4.0.0"
node-fetch "^2.6.7"
superstruct "^1.0.3"
jmespath@0.16.0:
version "0.16.0"
resolved "https://registry.yarnpkg.com/jmespath/-/jmespath-0.16.0.tgz#b15b0a85dfd4d930d43e69ed605943c802785076"
integrity sha512-9FzQjJ7MATs1tSpnco1K6ayiYE3figslrXA72G2HQ/n76RzvYlofyi5QM+iX4YRs/pu3yzxlVQSST23+dMDknw==
joi@^17.3.0:
version "17.11.0"
resolved "https://registry.yarnpkg.com/joi/-/joi-17.11.0.tgz#aa9da753578ec7720e6f0ca2c7046996ed04fc1a"
integrity sha512-NgB+lZLNoqISVy1rZocE9PZI36bL/77ie924Ri43yEvi9GUUMPeyVIr8KdFTMUlby1p0PBYMk9spIxEUQYqrJQ==
dependencies:
"@hapi/hoek" "^9.0.0"
"@hapi/topo" "^5.0.0"
"@sideway/address" "^4.1.3"
"@sideway/formula" "^3.0.1"
"@sideway/pinpoint" "^2.0.0"
js-sha256@^0.11.0:
version "0.11.0"
resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.11.0.tgz#256a921d9292f7fe98905face82e367abaca9576"
integrity sha512-6xNlKayMZvds9h1Y1VWc0fQHQ82BxTXizWPEtEeGvmOUYpBRy4gbWroHLpzowe6xiQhHpelCQiE7HEdznyBL9Q==
js-sha256@^0.9.0:
version "0.9.0"
resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966"
integrity sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==
js-tokens@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==
js-yaml@4.1.0, js-yaml@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==
dependencies:
argparse "^2.0.1"
js-yaml@^3.13.1:
version "3.14.1"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537"
integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==
dependencies:
argparse "^1.0.7"
esprima "^4.0.0"
json-buffer@3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13"
integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==
json-schema-traverse@^0.4.1:
version "0.4.1"
resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660"
integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==
json-schema-traverse@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2"
integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==
json-stable-stringify-without-jsonify@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651"
integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==
json-stringify-safe@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==
jsonparse@^1.2.0:
version "1.3.1"
resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280"
integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==
keyv@^4.5.3:
version "4.5.4"
resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93"
integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==
dependencies:
json-buffer "3.0.1"
kuler@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/kuler/-/kuler-2.0.0.tgz#e2c570a3800388fb44407e851531c1d670b061b3"
integrity sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==
levn@^0.4.1:
version "0.4.1"
resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade"
integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==
dependencies:
prelude-ls "^1.2.1"
type-check "~0.4.0"
light-my-request@^4.2.0:
version "4.12.0"
resolved "https://registry.yarnpkg.com/light-my-request/-/light-my-request-4.12.0.tgz#fd59329a7b4f794842103c7bef69e12252478831"
integrity sha512-0y+9VIfJEsPVzK5ArSIJ8Dkxp8QMP7/aCuxCUtG/tr9a2NoOf/snATE/OUc05XUplJCEnRh6gTkH7xh9POt1DQ==
dependencies:
ajv "^8.1.0"
cookie "^0.5.0"
process-warning "^1.0.0"
set-cookie-parser "^2.4.1"
locate-path@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286"
integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==
dependencies:
p-locate "^5.0.0"
lodash.camelcase@^4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6"
integrity sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==
lodash.merge@4.6.2, lodash.merge@^4.6.2:
version "4.6.2"
resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a"
integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==
lodash.truncate@^4.4.2:
version "4.4.2"
resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193"
integrity sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==
lodash@^4.17.21:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
log-symbols@4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503"
integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==
dependencies:
chalk "^4.1.0"
is-unicode-supported "^0.1.0"
logform@^2.3.2, logform@^2.4.0:
version "2.6.0"
resolved "https://registry.yarnpkg.com/logform/-/logform-2.6.0.tgz#8c82a983f05d6eaeb2d75e3decae7a768b2bf9b5"
integrity sha512-1ulHeNPp6k/LD8H91o7VYFBng5i1BDE7HoKxVbZiGFidS1Rj65qcywLxX+pVfAPoQJEjRdvKcusKwOupHCVOVQ==
dependencies:
"@colors/colors" "1.6.0"
"@types/triple-beam" "^1.3.2"
fecha "^4.2.0"
ms "^2.1.1"
safe-stable-stringify "^2.3.1"
triple-beam "^1.3.0"
long@^5.0.0:
version "5.2.3"
resolved "https://registry.yarnpkg.com/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1"
integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==
loupe@^2.3.6:
version "2.3.7"
resolved "https://registry.yarnpkg.com/loupe/-/loupe-2.3.7.tgz#6e69b7d4db7d3ab436328013d37d1c8c3540c697"
integrity sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==
dependencies:
get-func-name "^2.0.1"
lower-case@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-2.0.2.tgz#6fa237c63dbdc4a82ca0fd882e4722dc5e634e28"
integrity sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==
dependencies:
tslib "^2.0.3"
lru-cache@10.2.0:
version "10.2.0"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.2.0.tgz#0bd445ca57363465900f4d1f9bd8db343a4d95c3"
integrity sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==
lru-cache@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==
dependencies:
yallist "^4.0.0"
make-error@^1.1.1:
version "1.3.6"
resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==
merge2@^1.3.0, merge2@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==
micromatch@^4.0.4:
version "4.0.5"
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6"
integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==
dependencies:
braces "^3.0.2"
picomatch "^2.3.1"
mime-db@1.52.0:
version "1.52.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70"
integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==
mime-types@^2.1.12:
version "2.1.35"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a"
integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==
dependencies:
mime-db "1.52.0"
minimatch@5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.0.1.tgz#fb9022f7528125187c92bd9e9b6366be1cf3415b"
integrity sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==
dependencies:
brace-expansion "^2.0.1"
minimatch@^3.0.4, minimatch@^3.1.1:
version "3.1.2"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
dependencies:
brace-expansion "^1.1.7"
minimist@1.2.8:
version "1.2.8"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c"
integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==
mocha@10.2.0:
version "10.2.0"
resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.2.0.tgz#1fd4a7c32ba5ac372e03a17eef435bd00e5c68b8"
integrity sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==
dependencies:
ansi-colors "4.1.1"
browser-stdout "1.3.1"
chokidar "3.5.3"
debug "4.3.4"
diff "5.0.0"
escape-string-regexp "4.0.0"
find-up "5.0.0"
glob "7.2.0"
he "1.2.0"
js-yaml "4.1.0"
log-symbols "4.1.0"
minimatch "5.0.1"
ms "2.1.3"
nanoid "3.3.3"
serialize-javascript "6.0.0"
strip-json-comments "3.1.1"
supports-color "8.1.1"
workerpool "6.2.1"
yargs "16.2.0"
yargs-parser "20.2.4"
yargs-unparser "2.0.0"
module-details-from-path@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/module-details-from-path/-/module-details-from-path-1.0.3.tgz#114c949673e2a8a35e9d35788527aa37b679da2b"
integrity sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A==
ms@2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
ms@2.1.3, ms@^2.0.0, ms@^2.1.1:
version "2.1.3"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
nanoid@3.3.3:
version "3.3.3"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.3.tgz#fd8e8b7aa761fe807dba2d1b98fb7241bb724a25"
integrity sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==
natural-compare-lite@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz#17b09581988979fddafe0201e931ba933c96cbb4"
integrity sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==
natural-compare@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==
no-case@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d"
integrity sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==
dependencies:
lower-case "^2.0.2"
tslib "^2.0.3"
node-cache@5.1.2:
version "5.1.2"
resolved "https://registry.yarnpkg.com/node-cache/-/node-cache-5.1.2.tgz#f264dc2ccad0a780e76253a694e9fd0ed19c398d"
integrity sha512-t1QzWwnk4sjLWaQAS8CHgOJ+RAfmHpxFWmc36IWTiWHQfs0w5JDMBS1b1ZxQteo0vVVuWJvIUKHDkkeK7vIGCg==
dependencies:
clone "2.x"
node-fetch@^2.6.12, node-fetch@^2.6.7, node-fetch@^2.7.0:
version "2.7.0"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d"
integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==
dependencies:
whatwg-url "^5.0.0"
node-gyp-build@^4.3.0:
version "4.8.0"
resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.8.0.tgz#3fee9c1731df4581a3f9ead74664369ff00d26dd"
integrity sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og==
normalize-path@^3.0.0, normalize-path@~3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==
object-is@^1.1.5:
version "1.1.6"
resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.6.tgz#1a6a53aed2dd8f7e6775ff870bea58545956ab07"
integrity sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==
dependencies:
call-bind "^1.0.7"
define-properties "^1.2.1"
object-keys@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e"
integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==
object.assign@^4.1.4:
version "4.1.5"
resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.5.tgz#3a833f9ab7fdb80fc9e8d2300c803d216d8fdbb0"
integrity sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==
dependencies:
call-bind "^1.0.5"
define-properties "^1.2.1"
has-symbols "^1.0.3"
object-keys "^1.1.1"
obuf@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e"
integrity sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==
on-exit-leak-free@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/on-exit-leak-free/-/on-exit-leak-free-0.2.0.tgz#b39c9e3bf7690d890f4861558b0d7b90a442d209"
integrity sha512-dqaz3u44QbRXQooZLTUKU41ZrzYrcvLISVgbrzbyCMxpmSLJvZ3ZamIJIZ29P6OhZIkNIQKosdeM6t1LYbA9hg==
once@^1.3.0, once@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==
dependencies:
wrappy "1"
one-time@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/one-time/-/one-time-1.0.0.tgz#e06bc174aed214ed58edede573b433bbf827cb45"
integrity sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==
dependencies:
fn.name "1.x.x"
optionator@^0.9.1:
version "0.9.3"
resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64"
integrity sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==
dependencies:
"@aashutoshrathi/word-wrap" "^1.2.3"
deep-is "^0.1.3"
fast-levenshtein "^2.0.6"
levn "^0.4.1"
prelude-ls "^1.2.1"
type-check "^0.4.0"
p-limit@^3.0.2:
version "3.1.0"
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b"
integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==
dependencies:
yocto-queue "^0.1.0"
p-locate@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834"
integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==
dependencies:
p-limit "^3.0.2"
pako@^2.0.3:
version "2.1.0"
resolved "https://registry.yarnpkg.com/pako/-/pako-2.1.0.tgz#266cc37f98c7d883545d11335c00fbd4062c9a86"
integrity sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==
parent-module@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2"
integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==
dependencies:
callsites "^3.0.0"
path-exists@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3"
integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==
path-is-absolute@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==
path-key@^3.1.0:
version "3.1.1"
resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375"
integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==
path-parse@^1.0.7:
version "1.0.7"
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
path-type@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b"
integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==
pathval@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d"
integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==
pg-int8@1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/pg-int8/-/pg-int8-1.0.1.tgz#943bd463bf5b71b4170115f80f8efc9a0c0eb78c"
integrity sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==
pg-numeric@1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/pg-numeric/-/pg-numeric-1.0.2.tgz#816d9a44026086ae8ae74839acd6a09b0636aa3a"
integrity sha512-BM/Thnrw5jm2kKLE5uJkXqqExRUY/toLHda65XgFTBTFYZyopbKjBe29Ii3RbkvlsMoFwD+tHeGaCjjv0gHlyw==
pg-protocol@*:
version "1.6.0"
resolved "https://registry.yarnpkg.com/pg-protocol/-/pg-protocol-1.6.0.tgz#4c91613c0315349363af2084608db843502f8833"
integrity sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q==
pg-types@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/pg-types/-/pg-types-2.2.0.tgz#2d0250d636454f7cfa3b6ae0382fdfa8063254a3"
integrity sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==
dependencies:
pg-int8 "1.0.1"
postgres-array "~2.0.0"
postgres-bytea "~1.0.0"
postgres-date "~1.0.4"
postgres-interval "^1.1.0"
pg-types@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/pg-types/-/pg-types-4.0.1.tgz#31857e89d00a6c66b06a14e907c3deec03889542"
integrity sha512-hRCSDuLII9/LE3smys1hRHcu5QGcLs9ggT7I/TCs0IE+2Eesxi9+9RWAAwZ0yaGjxoWICF/YHLOEjydGujoJ+g==
dependencies:
pg-int8 "1.0.1"
pg-numeric "1.0.2"
postgres-array "~3.0.1"
postgres-bytea "~3.0.0"
postgres-date "~2.0.1"
postgres-interval "^3.0.0"
postgres-range "^1.1.1"
picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
pino-abstract-transport@v0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/pino-abstract-transport/-/pino-abstract-transport-0.5.0.tgz#4b54348d8f73713bfd14e3dc44228739aa13d9c0"
integrity sha512-+KAgmVeqXYbTtU2FScx1XS3kNyfZ5TrXY07V96QnUSFqo2gAqlvmaxH67Lj7SWazqsMabf+58ctdTcBgnOLUOQ==
dependencies:
duplexify "^4.1.2"
split2 "^4.0.0"
pino-std-serializers@^3.1.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/pino-std-serializers/-/pino-std-serializers-3.2.0.tgz#b56487c402d882eb96cd67c257868016b61ad671"
integrity sha512-EqX4pwDPrt3MuOAAUBMU0Tk5kR/YcCM5fNPEzgCO2zJ5HfX0vbiH9HbJglnyeQsN96Kznae6MWD47pZB5avTrg==
pino-std-serializers@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/pino-std-serializers/-/pino-std-serializers-4.0.0.tgz#1791ccd2539c091ae49ce9993205e2cd5dbba1e2"
integrity sha512-cK0pekc1Kjy5w9V2/n+8MkZwusa6EyyxfeQCB799CQRhRt/CqYKiWs5adeu8Shve2ZNffvfC/7J64A2PJo1W/Q==
pino@7.10.0:
version "7.10.0"
resolved "https://registry.yarnpkg.com/pino/-/pino-7.10.0.tgz#c621a3acf3b7aa50a6156c1b3989d1703666b2b1"
integrity sha512-T6R92jy/APDElEuOk0gqa4nds3ZgqFbHde2X0g8XorlyPlVGlr9T5KQphtp72a3ByKOdZMg/gM/0IprpGQfTWg==
dependencies:
atomic-sleep "^1.0.0"
fast-redact "^3.0.0"
on-exit-leak-free "^0.2.0"
pino-abstract-transport v0.5.0
pino-std-serializers "^4.0.0"
process-warning "^1.0.0"
quick-format-unescaped "^4.0.3"
real-require "^0.1.0"
safe-stable-stringify "^2.1.0"
sonic-boom "^2.2.1"
thread-stream "^0.15.1"
pino@^6.13.0:
version "6.14.0"
resolved "https://registry.yarnpkg.com/pino/-/pino-6.14.0.tgz#b745ea87a99a6c4c9b374e4f29ca7910d4c69f78"
integrity sha512-iuhEDel3Z3hF9Jfe44DPXR8l07bhjuFY3GMHIXbjnY9XcafbyDDwl2sN2vw2GjMPf5Nkoe+OFao7ffn9SXaKDg==
dependencies:
fast-redact "^3.0.0"
fast-safe-stringify "^2.0.8"
flatstr "^1.0.12"
pino-std-serializers "^3.1.0"
process-warning "^1.0.0"
quick-format-unescaped "^4.0.3"
sonic-boom "^1.0.2"
possible-typed-array-names@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz#89bb63c6fada2c3e90adc4a647beeeb39cc7bf8f"
integrity sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==
postgres-array@~2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/postgres-array/-/postgres-array-2.0.0.tgz#48f8fce054fbc69671999329b8834b772652d82e"
integrity sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==
postgres-array@~3.0.1:
version "3.0.2"
resolved "https://registry.yarnpkg.com/postgres-array/-/postgres-array-3.0.2.tgz#68d6182cb0f7f152a7e60dc6a6889ed74b0a5f98"
integrity sha512-6faShkdFugNQCLwucjPcY5ARoW1SlbnrZjmGl0IrrqewpvxvhSLHimCVzqeuULCbG0fQv7Dtk1yDbG3xv7Veog==
postgres-bytea@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/postgres-bytea/-/postgres-bytea-1.0.0.tgz#027b533c0aa890e26d172d47cf9ccecc521acd35"
integrity sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==
postgres-bytea@~3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/postgres-bytea/-/postgres-bytea-3.0.0.tgz#9048dc461ac7ba70a6a42d109221619ecd1cb089"
integrity sha512-CNd4jim9RFPkObHSjVHlVrxoVQXz7quwNFpz7RY1okNNme49+sVyiTvTRobiLV548Hx/hb1BG+iE7h9493WzFw==
dependencies:
obuf "~1.1.2"
postgres-date@~1.0.4:
version "1.0.7"
resolved "https://registry.yarnpkg.com/postgres-date/-/postgres-date-1.0.7.tgz#51bc086006005e5061c591cee727f2531bf641a8"
integrity sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==
postgres-date@~2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/postgres-date/-/postgres-date-2.0.1.tgz#638b62e5c33764c292d37b08f5257ecb09231457"
integrity sha512-YtMKdsDt5Ojv1wQRvUhnyDJNSr2dGIC96mQVKz7xufp07nfuFONzdaowrMHjlAzY6GDLd4f+LUHHAAM1h4MdUw==
postgres-interval@^1.1.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/postgres-interval/-/postgres-interval-1.2.0.tgz#b460c82cb1587507788819a06aa0fffdb3544695"
integrity sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==
dependencies:
xtend "^4.0.0"
postgres-interval@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/postgres-interval/-/postgres-interval-3.0.0.tgz#baf7a8b3ebab19b7f38f07566c7aab0962f0c86a"
integrity sha512-BSNDnbyZCXSxgA+1f5UU2GmwhoI0aU5yMxRGO8CdFEcY2BQF9xm/7MqKnYoM1nJDk8nONNWDk9WeSmePFhQdlw==
postgres-range@^1.1.1:
version "1.1.3"
resolved "https://registry.yarnpkg.com/postgres-range/-/postgres-range-1.1.3.tgz#9ccd7b01ca2789eb3c2e0888b3184225fa859f76"
integrity sha512-VdlZoocy5lCP0c/t66xAfclglEapXPCIVhqqJRncYpvbCgImF0w67aPKfbqUMr72tO2k5q0TdTZwCLjPTI6C9g==
prelude-ls@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==
prettier-linter-helpers@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b"
integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==
dependencies:
fast-diff "^1.1.2"
prettier@3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.1.tgz#65271fc9320ce4913c57747a70ce635b30beaa40"
integrity sha512-fcOWSnnpCrovBsmFZIGIy9UqK2FaI7Hqax+DIO0A9UxeVoY4iweyaFjS5TavZN97Hfehph0nhsZnjlVKzEQSrQ==
prettier@^2.5.1:
version "2.8.8"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"
integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==
process-warning@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/process-warning/-/process-warning-1.0.0.tgz#980a0b25dc38cd6034181be4b7726d89066b4616"
integrity sha512-du4wfLyj4yCZq1VupnVSZmRsPJsNuxoDQFdCFHLaYiEbFBD7QE0a+I4D7hOxrVnh78QE/YipFAj9lXHiXocV+Q==
progress@^2.0.0:
version "2.0.3"
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==
protobufjs@^7.2.4:
version "7.2.5"
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.2.5.tgz#45d5c57387a6d29a17aab6846dcc283f9b8e7f2d"
integrity sha512-gGXRSXvxQ7UiPgfw8gevrfRWcTlSbOFg+p/N+JVJEK5VhueL2miT6qTymqAmjr1Q5WbOCyJbyrk6JfWKwlFn6A==
dependencies:
"@protobufjs/aspromise" "^1.1.2"
"@protobufjs/base64" "^1.1.2"
"@protobufjs/codegen" "^2.0.4"
"@protobufjs/eventemitter" "^1.1.0"
"@protobufjs/fetch" "^1.1.0"
"@protobufjs/float" "^1.0.2"
"@protobufjs/inquire" "^1.1.0"
"@protobufjs/path" "^1.1.2"
"@protobufjs/pool" "^1.1.0"
"@protobufjs/utf8" "^1.1.0"
"@types/node" ">=13.7.0"
long "^5.0.0"
protobufjs@^7.2.5:
version "7.4.0"
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.4.0.tgz#7efe324ce9b3b61c82aae5de810d287bc08a248a"
integrity sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw==
dependencies:
"@protobufjs/aspromise" "^1.1.2"
"@protobufjs/base64" "^1.1.2"
"@protobufjs/codegen" "^2.0.4"
"@protobufjs/eventemitter" "^1.1.0"
"@protobufjs/fetch" "^1.1.0"
"@protobufjs/float" "^1.0.2"
"@protobufjs/inquire" "^1.1.0"
"@protobufjs/path" "^1.1.2"
"@protobufjs/pool" "^1.1.0"
"@protobufjs/utf8" "^1.1.0"
"@types/node" ">=13.7.0"
long "^5.0.0"
protobufjs@^7.2.6:
version "7.3.2"
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.3.2.tgz#60f3b7624968868f6f739430cfbc8c9370e26df4"
integrity sha512-RXyHaACeqXeqAKGLDl68rQKbmObRsTIn4TYVUUug1KfS47YWCo5MacGITEryugIgZqORCvJWEk4l449POg5Txg==
dependencies:
"@protobufjs/aspromise" "^1.1.2"
"@protobufjs/base64" "^1.1.2"
"@protobufjs/codegen" "^2.0.4"
"@protobufjs/eventemitter" "^1.1.0"
"@protobufjs/fetch" "^1.1.0"
"@protobufjs/float" "^1.0.2"
"@protobufjs/inquire" "^1.1.0"
"@protobufjs/path" "^1.1.2"
"@protobufjs/pool" "^1.1.0"
"@protobufjs/utf8" "^1.1.0"
"@types/node" ">=13.7.0"
long "^5.0.0"
proxy-addr@^2.0.7:
version "2.0.7"
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025"
integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==
dependencies:
forwarded "0.2.0"
ipaddr.js "1.9.1"
proxy-from-env@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2"
integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==
punycode@1.3.2:
version "1.3.2"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d"
integrity sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==
punycode@^2.1.0:
version "2.3.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5"
integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==
querystring@0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620"
integrity sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g==
queue-microtask@^1.1.2, queue-microtask@^1.2.2:
version "1.2.3"
resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243"
integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==
quick-format-unescaped@^4.0.3:
version "4.0.4"
resolved "https://registry.yarnpkg.com/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz#93ef6dd8d3453cbc7970dd614fad4c5954d6b5a7"
integrity sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==
randombytes@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a"
integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==
dependencies:
safe-buffer "^5.1.0"
readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.0:
version "3.6.2"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967"
integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==
dependencies:
inherits "^2.0.3"
string_decoder "^1.1.1"
util-deprecate "^1.0.1"
readdirp@~3.6.0:
version "3.6.0"
resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7"
integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==
dependencies:
picomatch "^2.2.1"
real-require@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/real-require/-/real-require-0.1.0.tgz#736ac214caa20632847b7ca8c1056a0767df9381"
integrity sha512-r/H9MzAWtrv8aSVjPCMFpDMl5q66GqtmmRkRjpHTsp4zBAa+snZyiQNlMONiUmEJcsnaw0wCauJ2GWODr/aFkg==
regenerator-runtime@^0.14.0:
version "0.14.1"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f"
integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==
regexpp@^3.1.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2"
integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==
require-directory@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==
require-from-string@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909"
integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==
require-in-the-middle@^5.0.3:
version "5.2.0"
resolved "https://registry.yarnpkg.com/require-in-the-middle/-/require-in-the-middle-5.2.0.tgz#4b71e3cc7f59977100af9beb76bf2d056a5a6de2"
integrity sha512-efCx3b+0Z69/LGJmm9Yvi4cqEdxnoGnxYxGxBghkkTTFeXRtTCmmhO0AnAfHz59k957uTSuy8WaHqOs8wbYUWg==
dependencies:
debug "^4.1.1"
module-details-from-path "^1.0.3"
resolve "^1.22.1"
resolve-from@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"
integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==
resolve@^1.22.1:
version "1.22.8"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d"
integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==
dependencies:
is-core-module "^2.13.0"
path-parse "^1.0.7"
supports-preserve-symlinks-flag "^1.0.0"
ret@~0.2.0:
version "0.2.2"
resolved "https://registry.yarnpkg.com/ret/-/ret-0.2.2.tgz#b6861782a1f4762dce43402a71eb7a283f44573c"
integrity sha512-M0b3YWQs7R3Z917WRQy1HHA7Ba7D8hvZg6UE5mLykJxQVE2ju0IXbGlaHPPlkY+WN7wFP+wUMXmBFA0aV6vYGQ==
reusify@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76"
integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==
rfdc@^1.1.4, rfdc@^1.2.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b"
integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==
rimraf@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a"
integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==
dependencies:
glob "^7.1.3"
rpc-websockets@7.11.0:
version "7.11.0"
resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.11.0.tgz#05451975963a7d1a4cf36d54e200bfc4402a56d7"
integrity sha512-IkLYjayPv6Io8C/TdCL5gwgzd1hFz2vmBZrjMw/SPEXo51ETOhnzgS4Qy5GWi2JQN7HKHa66J3+2mv0fgNh/7w==
dependencies:
eventemitter3 "^4.0.7"
uuid "^8.3.2"
ws "^8.5.0"
optionalDependencies:
bufferutil "^4.0.1"
utf-8-validate "^5.0.2"
rpc-websockets@7.5.1:
version "7.5.1"
resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.5.1.tgz#e0a05d525a97e7efc31a0617f093a13a2e10c401"
integrity sha512-kGFkeTsmd37pHPMaHIgN1LVKXMi0JD782v4Ds9ZKtLlwdTKjn+CxM9A9/gLT2LaOuEcEFGL98h1QWQtlOIdW0w==
dependencies:
"@babel/runtime" "^7.17.2"
eventemitter3 "^4.0.7"
uuid "^8.3.2"
ws "^8.5.0"
optionalDependencies:
bufferutil "^4.0.1"
utf-8-validate "^5.0.2"
rpc-websockets@^7.5.1:
version "7.9.0"
resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.9.0.tgz#a3938e16d6f134a3999fdfac422a503731bf8973"
integrity sha512-DwKewQz1IUA5wfLvgM8wDpPRcr+nWSxuFxx5CbrI2z/MyyZ4nXLM86TvIA+cI1ZAdqC8JIBR1mZR55dzaLU+Hw==
dependencies:
"@babel/runtime" "^7.17.2"
eventemitter3 "^4.0.7"
uuid "^8.3.2"
ws "^8.5.0"
optionalDependencies:
bufferutil "^4.0.1"
utf-8-validate "^5.0.2"
rpc-websockets@^8.0.1:
version "8.0.1"
resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-8.0.1.tgz#fa76db08badc0b2f5cd66b5496debd2c404c94b1"
integrity sha512-PptrPRK40uQvifq5sCcObmqInVcZXhy+RRrirzdE5KUPvDI47y1wPvfckD2QzqngOU9xaPW/dT+G+b+wj6M1MQ==
dependencies:
eventemitter3 "^4.0.7"
uuid "^8.3.2"
ws "^8.5.0"
optionalDependencies:
bufferutil "^4.0.1"
utf-8-validate "^5.0.2"
rpc-websockets@^9.0.0, rpc-websockets@^9.0.2:
version "9.0.2"
resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-9.0.2.tgz#4c1568d00b8100f997379a363478f41f8f4b242c"
integrity sha512-YzggvfItxMY3Lwuax5rC18inhbjJv9Py7JXRHxTIi94JOLrqBsSsUUc5bbl5W6c11tXhdfpDPK0KzBhoGe8jjw==
dependencies:
"@swc/helpers" "^0.5.11"
"@types/uuid" "^8.3.4"
"@types/ws" "^8.2.2"
buffer "^6.0.3"
eventemitter3 "^5.0.1"
uuid "^8.3.2"
ws "^8.5.0"
optionalDependencies:
bufferutil "^4.0.1"
utf-8-validate "^5.0.2"
run-parallel@^1.1.9:
version "1.2.0"
resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee"
integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==
dependencies:
queue-microtask "^1.2.2"
safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@~5.2.0:
version "5.2.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
safe-regex2@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/safe-regex2/-/safe-regex2-2.0.0.tgz#b287524c397c7a2994470367e0185e1916b1f5b9"
integrity sha512-PaUSFsUaNNuKwkBijoAPHAK6/eM6VirvyPWlZ7BAQy4D+hCvh4B6lIG+nPdhbFfIbP+gTGBcrdsOaUs0F+ZBOQ==
dependencies:
ret "~0.2.0"
safe-stable-stringify@^2.1.0, safe-stable-stringify@^2.3.1:
version "2.4.3"
resolved "https://registry.yarnpkg.com/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz#138c84b6f6edb3db5f8ef3ef7115b8f55ccbf886"
integrity sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==
sax@1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.1.tgz#7b8e656190b228e81a66aea748480d828cd2d37a"
integrity sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==
sax@>=0.6.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/sax/-/sax-1.3.0.tgz#a5dbe77db3be05c9d1ee7785dbd3ea9de51593d0"
integrity sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==
secure-json-parse@^2.0.0:
version "2.7.0"
resolved "https://registry.yarnpkg.com/secure-json-parse/-/secure-json-parse-2.7.0.tgz#5a5f9cd6ae47df23dba3151edd06855d47e09862"
integrity sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw==
semver-store@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/semver-store/-/semver-store-0.3.0.tgz#ce602ff07df37080ec9f4fb40b29576547befbe9"
integrity sha512-TcZvGMMy9vodEFSse30lWinkj+JgOBvPn8wRItpQRSayhc+4ssDs335uklkfvQQJgL/WvmHLVj4Ycv2s7QCQMg==
semver@^7.2.1, semver@^7.3.2, semver@^7.3.5:
version "7.5.4"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e"
integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==
dependencies:
lru-cache "^6.0.0"
semver@^7.3.7:
version "7.6.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.0.tgz#1a46a4db4bffcccd97b743b5005c8325f23d4e2d"
integrity sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==
dependencies:
lru-cache "^6.0.0"
serialize-javascript@6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8"
integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==
dependencies:
randombytes "^2.1.0"
set-cookie-parser@^2.4.1:
version "2.6.0"
resolved "https://registry.yarnpkg.com/set-cookie-parser/-/set-cookie-parser-2.6.0.tgz#131921e50f62ff1a66a461d7d62d7b21d5d15a51"
integrity sha512-RVnVQxTXuerk653XfuliOxBP81Sf0+qfQE73LIYKcyMYHG94AuH0kgrQpRDuTZnSmjpysHmzxJXKNfa6PjFhyQ==
set-function-length@^1.2.1:
version "1.2.2"
resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449"
integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==
dependencies:
define-data-property "^1.1.4"
es-errors "^1.3.0"
function-bind "^1.1.2"
get-intrinsic "^1.2.4"
gopd "^1.0.1"
has-property-descriptors "^1.0.2"
shebang-command@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea"
integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==
dependencies:
shebang-regex "^3.0.0"
shebang-regex@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
shimmer@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/shimmer/-/shimmer-1.2.1.tgz#610859f7de327b587efebf501fb43117f9aff337"
integrity sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==
simple-swizzle@^0.2.2:
version "0.2.2"
resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a"
integrity sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==
dependencies:
is-arrayish "^0.3.1"
slash@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==
slice-ansi@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b"
integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==
dependencies:
ansi-styles "^4.0.0"
astral-regex "^2.0.0"
is-fullwidth-code-point "^3.0.0"
snake-case@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c"
integrity sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==
dependencies:
dot-case "^3.0.4"
tslib "^2.0.3"
solana-bankrun-darwin-arm64@0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/solana-bankrun-darwin-arm64/-/solana-bankrun-darwin-arm64-0.3.1.tgz#65ab6cd2e74eef260c38251f4c53721cf5b9030f"
integrity sha512-9LWtH/3/WR9fs8Ve/srdo41mpSqVHmRqDoo69Dv1Cupi+o1zMU6HiEPUHEvH2Tn/6TDbPEDf18MYNfReLUqE6A==
solana-bankrun-darwin-universal@0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/solana-bankrun-darwin-universal/-/solana-bankrun-darwin-universal-0.3.1.tgz#bf691457cf046e8739c021ca11e48de5b4fefd45"
integrity sha512-muGHpVYWT7xCd8ZxEjs/bmsbMp8XBqroYGbE4lQPMDUuLvsJEIrjGqs3MbxEFr71sa58VpyvgywWd5ifI7sGIg==
solana-bankrun-darwin-x64@0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/solana-bankrun-darwin-x64/-/solana-bankrun-darwin-x64-0.3.1.tgz#c6f30c0a6bc3e1621ed90ce7562f26e93bf5303f"
integrity sha512-oCaxfHyt7RC3ZMldrh5AbKfy4EH3YRMl8h6fSlMZpxvjQx7nK7PxlRwMeflMnVdkKKp7U8WIDak1lilIPd3/lg==
solana-bankrun-linux-x64-gnu@0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/solana-bankrun-linux-x64-gnu/-/solana-bankrun-linux-x64-gnu-0.3.1.tgz#78b522f1a581955a48f43a8fb560709c11301cfd"
integrity sha512-PfRFhr7igGFNt2Ecfdzh3li9eFPB3Xhmk0Eib17EFIB62YgNUg3ItRnQQFaf0spazFjjJLnglY1TRKTuYlgSVA==
solana-bankrun-linux-x64-musl@0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/solana-bankrun-linux-x64-musl/-/solana-bankrun-linux-x64-musl-0.3.1.tgz#1a044a132138a0084e82406ec7bf4939f06bed68"
integrity sha512-6r8i0NuXg3CGURql8ISMIUqhE7Hx/O7MlIworK4oN08jYrP0CXdLeB/hywNn7Z8d1NXrox/NpYUgvRm2yIzAsQ==
solana-bankrun@0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/solana-bankrun/-/solana-bankrun-0.3.1.tgz#13665ab7c1c15ec2b3354aae56980d0ded514998"
integrity sha512-inRwON7fBU5lPC36HdEqPeDg15FXJYcf77+o0iz9amvkUMJepcwnRwEfTNyMVpVYdgjTOBW5vg+596/3fi1kGA==
dependencies:
"@solana/web3.js" "^1.68.0"
bs58 "^4.0.1"
optionalDependencies:
solana-bankrun-darwin-arm64 "0.3.1"
solana-bankrun-darwin-universal "0.3.1"
solana-bankrun-darwin-x64 "0.3.1"
solana-bankrun-linux-x64-gnu "0.3.1"
solana-bankrun-linux-x64-musl "0.3.1"
sonic-boom@^1.0.2:
version "1.4.1"
resolved "https://registry.yarnpkg.com/sonic-boom/-/sonic-boom-1.4.1.tgz#d35d6a74076624f12e6f917ade7b9d75e918f53e"
integrity sha512-LRHh/A8tpW7ru89lrlkU4AszXt1dbwSjVWguGrmlxE7tawVmDBlI1PILMkXAxJTwqhgsEeTHzj36D5CmHgQmNg==
dependencies:
atomic-sleep "^1.0.0"
flatstr "^1.0.12"
sonic-boom@^2.2.1:
version "2.8.0"
resolved "https://registry.yarnpkg.com/sonic-boom/-/sonic-boom-2.8.0.tgz#c1def62a77425090e6ad7516aad8eb402e047611"
integrity sha512-kuonw1YOYYNOve5iHdSahXPOK49GqwA+LZhI6Wz/l0rP57iKyXXIHaRagOBHAPmGwJC6od2Z9zgvZ5loSgMlVg==
dependencies:
atomic-sleep "^1.0.0"
split2@^4.0.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/split2/-/split2-4.2.0.tgz#c9c5920904d148bab0b9f67145f245a86aadbfa4"
integrity sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==
spok@^1.4.3:
version "1.5.5"
resolved "https://registry.yarnpkg.com/spok/-/spok-1.5.5.tgz#a51f7f290a53131d7b7a922dfedc461dda0aed72"
integrity sha512-IrJIXY54sCNFASyHPOY+jEirkiJ26JDqsGiI0Dvhwcnkl0PEWi1PSsrkYql0rzDw8LFVTcA7rdUCAJdE2HE+2Q==
dependencies:
ansicolors "~0.3.2"
find-process "^1.4.7"
sprintf-js@~1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==
stack-trace@0.0.x:
version "0.0.10"
resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0"
integrity sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==
stream-shift@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d"
integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==
strict-event-emitter-types@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/strict-event-emitter-types/-/strict-event-emitter-types-2.0.0.tgz#05e15549cb4da1694478a53543e4e2f4abcf277f"
integrity sha512-Nk/brWYpD85WlOgzw5h173aci0Teyv8YdIAEtV+N88nDB0dLlazZyJMIsN6eo1/AR61l+p6CJTG1JIyFaoNEEA==
string-similarity@^4.0.1:
version "4.0.4"
resolved "https://registry.yarnpkg.com/string-similarity/-/string-similarity-4.0.4.tgz#42d01ab0b34660ea8a018da8f56a3309bb8b2a5b"
integrity sha512-/q/8Q4Bl4ZKAPjj8WerIBJWALKkaPRfrvhfF8k/B23i4nzrlRj2/go1m90In7nG/3XDSbOo0+pu6RvCTM9RGMQ==
string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"
string_decoder@^1.1.1:
version "1.3.0"
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e"
integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==
dependencies:
safe-buffer "~5.2.0"
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"
strip-json-comments@3.1.1, strip-json-comments@^3.1.0, strip-json-comments@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006"
integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==
superstruct@^0.14.2:
version "0.14.2"
resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.14.2.tgz#0dbcdf3d83676588828f1cf5ed35cda02f59025b"
integrity sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ==
superstruct@^0.15.4:
version "0.15.5"
resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.15.5.tgz#0f0a8d3ce31313f0d84c6096cd4fa1bfdedc9dab"
integrity sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ==
superstruct@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-1.0.3.tgz#de626a5b49c6641ff4d37da3c7598e7a87697046"
integrity sha512-8iTn3oSS8nRGn+C2pgXSKPI3jmpm6FExNazNpjvqS6ZUJQCej3PUXEKM8NjHBOs54ExM+LPW/FBRhymrdcCiSg==
superstruct@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-1.0.4.tgz#0adb99a7578bd2f1c526220da6571b2d485d91ca"
integrity sha512-7JpaAoX2NGyoFlI9NBh66BQXGONc+uE+MRS5i2iOBKuS4e+ccgMDjATgZldkah+33DakBxDHiss9kvUcGAO8UQ==
superstruct@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-2.0.2.tgz#3f6d32fbdc11c357deff127d591a39b996300c54"
integrity sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A==
supports-color@8.1.1:
version "8.1.1"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c"
integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==
dependencies:
has-flag "^4.0.0"
supports-color@^5.3.0:
version "5.5.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==
dependencies:
has-flag "^3.0.0"
supports-color@^7.1.0:
version "7.2.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da"
integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==
dependencies:
has-flag "^4.0.0"
supports-preserve-symlinks-flag@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
table@^6.0.9:
version "6.8.1"
resolved "https://registry.yarnpkg.com/table/-/table-6.8.1.tgz#ea2b71359fe03b017a5fbc296204471158080bdf"
integrity sha512-Y4X9zqrCftUhMeH2EptSSERdVKt/nEdijTOacGD/97EKjhQ/Qs8RTlEGABSJNNN8lac9kheH+af7yAkEWlgneA==
dependencies:
ajv "^8.0.1"
lodash.truncate "^4.4.2"
slice-ansi "^4.0.0"
string-width "^4.2.3"
strip-ansi "^6.0.1"
text-encoding-utf-8@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz#585b62197b0ae437e3c7b5d0af27ac1021e10d13"
integrity sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg==
text-hex@1.0.x:
version "1.0.0"
resolved "https://registry.yarnpkg.com/text-hex/-/text-hex-1.0.0.tgz#69dc9c1b17446ee79a92bf5b884bb4b9127506f5"
integrity sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==
text-table@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==
thread-stream@^0.15.1:
version "0.15.2"
resolved "https://registry.yarnpkg.com/thread-stream/-/thread-stream-0.15.2.tgz#fb95ad87d2f1e28f07116eb23d85aba3bc0425f4"
integrity sha512-UkEhKIg2pD+fjkHQKyJO3yoIvAP3N6RlNFt2dUhcS1FGvCD1cQa1M/PGknCLFIyZdtJOWQjejp7bdNqmN7zwdA==
dependencies:
real-require "^0.1.0"
"through@>=2.2.7 <3":
version "2.3.8"
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==
tiny-lru@^8.0.1:
version "8.0.2"
resolved "https://registry.yarnpkg.com/tiny-lru/-/tiny-lru-8.0.2.tgz#812fccbe6e622ded552e3ff8a4c3b5ff34a85e4c"
integrity sha512-ApGvZ6vVvTNdsmt676grvCkUCGwzG9IqXma5Z07xJgiC5L7akUMof5U8G2JTI9Rz/ovtVhJBlY6mNhEvtjzOIg==
to-regex-range@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4"
integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==
dependencies:
is-number "^7.0.0"
toml@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/toml/-/toml-3.0.0.tgz#342160f1af1904ec9d204d03a5d61222d762c5ee"
integrity sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==
tr46@~0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"
integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==
traverse-chain@~0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/traverse-chain/-/traverse-chain-0.1.0.tgz#61dbc2d53b69ff6091a12a168fd7d433107e40f1"
integrity sha512-up6Yvai4PYKhpNp5PkYtx50m3KbwQrqDwbuZP/ItyL64YEWHAvH6Md83LFLV/GRSk/BoUVwwgUzX6SOQSbsfAg==
triple-beam@^1.3.0:
version "1.4.1"
resolved "https://registry.yarnpkg.com/triple-beam/-/triple-beam-1.4.1.tgz#6fde70271dc6e5d73ca0c3b24e2d92afb7441984"
integrity sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==
ts-log@^2.2.4:
version "2.2.5"
resolved "https://registry.yarnpkg.com/ts-log/-/ts-log-2.2.5.tgz#aef3252f1143d11047e2cb6f7cfaac7408d96623"
integrity sha512-PGcnJoTBnVGy6yYNFxWVNkdcAuAMstvutN9MgDJIV6L0oG8fB+ZNNy1T+wJzah8RPGor1mZuPQkVfXNDpy9eHA==
ts-node@10.9.1:
version "10.9.1"
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b"
integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==
dependencies:
"@cspotcode/source-map-support" "^0.8.0"
"@tsconfig/node10" "^1.0.7"
"@tsconfig/node12" "^1.0.7"
"@tsconfig/node14" "^1.0.0"
"@tsconfig/node16" "^1.0.2"
acorn "^8.4.1"
acorn-walk "^8.1.1"
arg "^4.1.0"
create-require "^1.1.0"
diff "^4.0.1"
make-error "^1.1.1"
v8-compile-cache-lib "^3.0.1"
yn "3.1.1"
tslib@^1.8.1:
version "1.14.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
tslib@^2.0.3, tslib@^2.3.1:
version "2.6.2"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae"
integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==
tslib@^2.4.0:
version "2.6.3"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0"
integrity sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==
tsutils@^3.21.0:
version "3.21.0"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623"
integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==
dependencies:
tslib "^1.8.1"
tweetnacl-util@0.15.1:
version "0.15.1"
resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b"
integrity sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==
tweetnacl@1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596"
integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==
type-check@^0.4.0, type-check@~0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1"
integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==
dependencies:
prelude-ls "^1.2.1"
type-detect@^4.0.0, type-detect@^4.0.8:
version "4.0.8"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c"
integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==
type-fest@^0.20.2:
version "0.20.2"
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4"
integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==
typescript@4.5.4:
version "4.5.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.4.tgz#a17d3a0263bf5c8723b9c52f43c5084edf13c2e8"
integrity sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==
typescript@^4.8.2:
version "4.9.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==
undici-types@~5.26.4:
version "5.26.5"
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617"
integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==
undici@6.19.2:
version "6.19.2"
resolved "https://registry.yarnpkg.com/undici/-/undici-6.19.2.tgz#231bc5de78d0dafb6260cf454b294576c2f3cd31"
integrity sha512-JfjKqIauur3Q6biAtHJ564e3bWa8VvT+7cSiOJHFbX4Erv6CLGDpg8z+Fmg/1OI/47RA+GI2QZaF48SSaLvyBA==
uri-js@^4.2.2:
version "4.4.1"
resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e"
integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==
dependencies:
punycode "^2.1.0"
url@0.10.3:
version "0.10.3"
resolved "https://registry.yarnpkg.com/url/-/url-0.10.3.tgz#021e4d9c7705f21bbf37d03ceb58767402774c64"
integrity sha512-hzSUW2q06EqL1gKM/a+obYHLIO6ct2hwPuviqTTOcfFVc61UbfJ2Q32+uGL/HCPxKqrdGB5QUwIe7UqlDgwsOQ==
dependencies:
punycode "1.3.2"
querystring "0.2.0"
utf-8-validate@^5.0.2:
version "5.0.10"
resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.10.tgz#d7d10ea39318171ca982718b6b96a8d2442571a2"
integrity sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==
dependencies:
node-gyp-build "^4.3.0"
util-deprecate@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==
util@^0.12.4, util@^0.12.5:
version "0.12.5"
resolved "https://registry.yarnpkg.com/util/-/util-0.12.5.tgz#5f17a6059b73db61a875668781a1c2b136bd6fbc"
integrity sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==
dependencies:
inherits "^2.0.3"
is-arguments "^1.0.4"
is-generator-function "^1.0.7"
is-typed-array "^1.1.3"
which-typed-array "^1.1.2"
uuid@8.0.0:
version "8.0.0"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.0.0.tgz#bc6ccf91b5ff0ac07bbcdbf1c7c4e150db4dbb6c"
integrity sha512-jOXGuXZAWdsTH7eZLtyXMqUb9EcWMGZNbL9YcGBJl4MH4nrxHmZJhEHvyLFrkxo+28uLb/NYRcStH48fnD0Vzw==
uuid@8.3.2, uuid@^8.3.2:
version "8.3.2"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==
v8-compile-cache-lib@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf"
integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==
v8-compile-cache@^2.0.3:
version "2.4.0"
resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.4.0.tgz#cdada8bec61e15865f05d097c5f4fd30e94dc128"
integrity sha512-ocyWc3bAHBB/guyqJQVI5o4BZkPhznPYUG2ea80Gond/BgNWpap8TOmLSeeQG7bnh2KMISxskdADG59j7zruhw==
webidl-conversions@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==
whatwg-url@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d"
integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==
dependencies:
tr46 "~0.0.3"
webidl-conversions "^3.0.0"
which-typed-array@^1.1.14, which-typed-array@^1.1.2:
version "1.1.15"
resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.15.tgz#264859e9b11a649b388bfaaf4f767df1f779b38d"
integrity sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==
dependencies:
available-typed-arrays "^1.0.7"
call-bind "^1.0.7"
for-each "^0.3.3"
gopd "^1.0.1"
has-tostringtag "^1.0.2"
which@^2.0.1:
version "2.0.2"
resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"
integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==
dependencies:
isexe "^2.0.0"
winston-transport@^4.5.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/winston-transport/-/winston-transport-4.6.0.tgz#f1c1a665ad1b366df72199e27892721832a19e1b"
integrity sha512-wbBA9PbPAHxKiygo7ub7BYRiKxms0tpfU2ljtWzb3SjRjv5yl6Ozuy/TkXf00HTAt+Uylo3gSkNwzc4ME0wiIg==
dependencies:
logform "^2.3.2"
readable-stream "^3.6.0"
triple-beam "^1.3.0"
winston@3.11.0:
version "3.11.0"
resolved "https://registry.yarnpkg.com/winston/-/winston-3.11.0.tgz#2d50b0a695a2758bb1c95279f0a88e858163ed91"
integrity sha512-L3yR6/MzZAOl0DsysUXHVjOwv8mKZ71TrA/41EIduGpOOV5LQVodqN+QdQ6BS6PJ/RdIshZhq84P/fStEZkk7g==
dependencies:
"@colors/colors" "^1.6.0"
"@dabh/diagnostics" "^2.0.2"
async "^3.2.3"
is-stream "^2.0.0"
logform "^2.4.0"
one-time "^1.0.0"
readable-stream "^3.4.0"
safe-stable-stringify "^2.3.1"
stack-trace "0.0.x"
triple-beam "^1.3.0"
winston-transport "^4.5.0"
workerpool@6.2.1:
version "6.2.1"
resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343"
integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==
wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"
wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==
ws@8.18.0:
version "8.18.0"
resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc"
integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==
ws@^7.4.5:
version "7.5.9"
resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591"
integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==
ws@^7.5.10:
version "7.5.10"
resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9"
integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==
ws@^8.5.0:
version "8.16.0"
resolved "https://registry.yarnpkg.com/ws/-/ws-8.16.0.tgz#d1cd774f36fbc07165066a60e40323eab6446fd4"
integrity sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==
ws@^8.6.0:
version "8.17.1"
resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b"
integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==
xml2js@0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.5.0.tgz#d9440631fbb2ed800203fad106f2724f62c493b7"
integrity sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==
dependencies:
sax ">=0.6.0"
xmlbuilder "~11.0.0"
xmlbuilder@~11.0.0:
version "11.0.1"
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3"
integrity sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==
xtend@^4.0.0:
version "4.0.2"
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54"
integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==
y18n@^5.0.5:
version "5.0.8"
resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55"
integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==
yallist@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==
yaml@2.3.4:
version "2.3.4"
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.4.tgz#53fc1d514be80aabf386dc6001eb29bf3b7523b2"
integrity sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==
yaml@^2.5.0:
version "2.5.1"
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.5.1.tgz#c9772aacf62cb7494a95b0c4f1fb065b563db130"
integrity sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==
yargs-parser@20.2.4:
version "20.2.4"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54"
integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==
yargs-parser@^20.2.2:
version "20.2.9"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee"
integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==
yargs-parser@^21.1.1:
version "21.1.1"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35"
integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==
yargs-unparser@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb"
integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==
dependencies:
camelcase "^6.0.0"
decamelize "^4.0.0"
flat "^5.0.2"
is-plain-obj "^2.1.0"
yargs@16.2.0:
version "16.2.0"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66"
integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==
dependencies:
cliui "^7.0.2"
escalade "^3.1.1"
get-caller-file "^2.0.5"
require-directory "^2.1.1"
string-width "^4.2.0"
y18n "^5.0.5"
yargs-parser "^20.2.2"
yargs@17.7.2, yargs@^17.7.2:
version "17.7.2"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269"
integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==
dependencies:
cliui "^8.0.1"
escalade "^3.1.1"
get-caller-file "^2.0.5"
require-directory "^2.1.1"
string-width "^4.2.3"
y18n "^5.0.5"
yargs-parser "^21.1.1"
yn@3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"
integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==
yocto-queue@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
zstddec@0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/zstddec/-/zstddec-0.1.0.tgz#7050f3f0e0c3978562d0c566b3e5a427d2bad7ec"
integrity sha512-w2NTI8+3l3eeltKAdK8QpiLo/flRAr2p8AGeakfMZOXBxOg9HIu4LVDxBi81sYgVhFhdJjv1OrB5ssI8uFPoLg==
| 0
|
solana_public_repos/drift-labs
|
solana_public_repos/drift-labs/keeper-bots-v2/.env.marketmakingexample
|
# create with solana-keygen pubkey /path/to/solana_private_key.json
KEEPER_PRIVATE_KEY=/path/to/solana_private_key.json
ENDPOINT=https://api.mainnet-beta.solana.com
DRIFT_ENV=mainnet-beta
DEBUG=false
| 0
|
solana_public_repos/drift-labs
|
solana_public_repos/drift-labs/keeper-bots-v2/example.config.yaml
|
global:
# devnet or mainnet-beta
driftEnv: mainnet-beta
# RPC endpoint to use
endpoint: https://you-need-your-own-rpc.com
# Custom websocket endpoint to use (if null will be determined from `endpoint``)
# Note: the default wsEndpoint value simply replaces http(s) with ws(s), so if
# your RPC provider requires a special path (i.e. /ws) for websocket connections
# you must set this.
wsEndpoint:
# optional if you want to use helius' global priority fee method AND `endpoint` is not
# already a helius url.
heliusEndpoint:
# optional endpoint to use for just confirming txs to check if they landed.
# loop purposefully runs slow so should work with public RPC
txConfirmationEndpoint: https://api.mainnet-beta.solana.com
# `solana` or `helius`. If `helius` `endpoint` must be a helius RPC, or `heliusEndpoint`
# must be set
# solana: uses https://solana.com/docs/rpc/http/getrecentprioritizationfees
# helius: uses https://docs.helius.dev/solana-rpc-nodes/alpha-priority-fee-api
priorityFeeMethod: solana
# skips preflight checks on sendTransaciton, default is false.
# this will speed up tx sending, but may increase SOL paid due to failed txs landing
# on chain
#txSkipPreflight: true
# max priority fee to use, in micro lamports
# i.e. a fill that uses 500_000 CUs will spend:
# 500_000 * 10_000 * 1e-6 * 1e-9 = 0.000005 SOL on priority fees
# this is on top of the 0.000005 SOL base fee, so 0.000010 SOL total
maxPriorityFeeMicroLamports: 10000
# Private key to use to sign transactions.
# will load from KEEPER_PRIVATE_KEY env var if null
keeperPrivateKey:
initUser: false # initialize user on startup
testLiveness: false # test liveness, by failing liveness test after 1 min
# Force deposit this amount of USDC to collateral account, the program will
# end after the deposit transaction is sent
#forceDeposit: 1000
websocket: true # use websocket for account loading and events (limited support)
eventSubscriber: false # disables event subscriber (heavy RPC demand), this is primary used for counting fills
runOnce: false # Set true to run once and exit, useful for testing or one off bot runs
debug: false # Enable debug logging
# subaccountIDs to load, if null will load subaccount 0 (default).
# Even if bot specific configs requires subaccountIDs, you should still
# specify it here, since we load the subaccounts before loading individual
# bots.
# subaccounts:
# - 0
# - 1
# - 2
subaccounts:
- 0
eventSubscriberPollingInterval: 5000
bulkAccountLoaderPollingInterval: 5000
useJito: false
# one of: ['non-jito-only', 'jito-only', 'hybrid'].
# * non-jito-only: will only send txs to RPC when there is no active jito leader
# * jito-only: will only send txs via bundle when there is an active jito leader
# * hybrid: will attempt to send bundles when active jito leader, and use RPC when not
# hybrid may not work well if using high throughput bots such as a filler depending on infra limitations.
jitoStrategy: jito-only
# the minimum tip to pay
jitoMinBundleTip: 10000
# the maximum tip to pay (will pay this once jitoMaxBundleFailCount is hit)
jitoMaxBundleTip: 100000
# the number of failed bundles (accepted but not landed) before tipping the max tip
jitoMaxBundleFailCount: 200
# the tip multiplier to use when tipping the max tip
# controls superlinearity (1 = linear, 2 = slightly-superlinear, 3 = more-superlinear, ...)
jitoTipMultiplier: 3
jitoBlockEngineUrl: frankfurt.mainnet.block-engine.jito.wtf
jitoAuthPrivateKey: /path/to/jito/bundle/signing/key/auth.json
onlySendDuringJitoLeader: false
# Which bots to run, be careful with this, running multiple bots in one instance
# might use more resources than expected.
# Bot specific configs are below
enabledBots:
# Perp order filler bot
- filler
# Spot order filler bot
# - spotFiller
# Trigger bot (triggers trigger orders)
- trigger
# Liquidator bot, liquidates unhealthy positions by taking over the risk (caution, you should manage risk here)
# - liquidator
# Example maker bot that participates in JIT auction (caution: you will probably lose money)
# - jitMaker
# Example maker bot that posts floating oracle orders
# - floatingMaker
# settles PnLs for the insurance fund (may want to run with runOnce: true)
# - ifRevenueSettler
# settles negative PnLs for users (may want to run with runOnce: true)
# - userPnlSettler
# - markTwapCrank
# below are bot configs
botConfigs:
filler:
botId: "filler"
dryRun: false
fillerPollingInterval: 6000
metricsPort: 9464
# will revert a transaction during simulation if a fill fails, this will save on tx fees,
# and be friendlier for use with services like Jito.
# Default is true
revertOnFailure: true
# calls simulateTransaction before sending to get an accurate CU estimate
# as well as stop before sending the transaction (Default is true)
simulateTxForCUEstimate: true
spotFiller:
botId: "spot-filler"
dryRun: false
fillerPollingInterval: 6000
metricsPort: 9464
revertOnFailure: true
simulateTxForCUEstimate: true
liquidator:
botId: "liquidator"
dryRun: false
metricsPort: 9465
# if true will NOT attempt to sell off any inherited positions
disableAutoDerisking: false
# if true will swap spot assets on jupiter if the price is better
useJupiter: true
# null will handle all markets
perpMarketIndicies:
spotMarketIndicies:
# specify which subaccount is ok with inheriting risk in each specified
# perp or spot market index. Leaving it null will watch
# all markets on the default global.subaccounts.0
perpSubAccountConfig:
0: # subaccount 0 will watch perp markets 0 and 1
- 0
- 1
spotSubAccountConfig: # will watch all spot markets on the default global.subaccounts.0
# deprecated (bad naming): use maxSlippageBps
maxSlippagePct: 50
# Max slippage to incur allow when derisking (in bps).
# This is used to calculate the auction end price (worse price) when derisking
# and also passed into jupiter when doing swaps.
maxSlippageBps: 50
# duration of jit auction for derisk orders
deriskAuctionDurationSlots: 100
# what algo to use for derisking. Options are "market" or "twap"
deriskAlgo: "market"
# if deriskAlgo == "twap", must supply these as well
# twapDurationSec: 300 # overall duration of to run the twap algo. Aims to derisk the entire position over this duration
# Minimum deposit amount to try to liquidiate, per spot market, in lamports.
# If null, or a spot market isn't here, it will liquidate any amount
# See perpMarkets.ts on the protocol codebase for the indices
minDepositToLiq:
1: 10
2: 1000
# Filter out un-liquidateable accounts that just create log noise
excludedAccounts:
- 9CJLgd5f9nmTp7KRV37RFcQrfEmJn6TU87N7VQAe2Pcq
- Edh39zr8GnQFNYwyvxhPngTJHrr29H3vVup8e8ZD4Hwu
# max % of collateral to spend when liquidating a user. In percentage terms (0.5 = 50%)
maxPositionTakeoverPctOfCollateral: 0.5
# sends a webhook notification (slack, discord, etc.) when a liquidation is attempted (can be noisy due to partial liquidations)
notifyOnLiquidation: true
# Will consider spot assets below this value to be "dust" and will be withdrawn to the authority wallet
# in human USD terms: 10.0 for 10.0 USD worth of spot assets
spotDustValueThreshold: 10
trigger:
botId: "trigger"
dryRun: false
metricsPort: 9465
markTwapCrank:
botId: "mark-twap-cranker"
dryRun: false
metricsPort: 9465
crankIntervalToMarketIndicies:
15000:
- 0
- 1
- 2
60000:
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
| 0
|
solana_public_repos/drift-labs
|
solana_public_repos/drift-labs/keeper-bots-v2/package.json
|
{
"name": "@drift-labs/order-filler",
"version": "0.1.0",
"author": "crispheaney",
"main": "lib/index.js",
"license": "Apache-2.0",
"dependencies": {
"@drift-labs/jit-proxy": "0.12.13",
"@drift-labs/sdk": "2.104.0-beta.23",
"@opentelemetry/api": "1.7.0",
"@opentelemetry/auto-instrumentations-node": "0.31.2",
"@opentelemetry/exporter-prometheus": "0.31.0",
"@opentelemetry/sdk-node": "0.31.0",
"@project-serum/anchor": "0.19.1-beta.1",
"@project-serum/serum": "0.13.65",
"@pythnetwork/price-service-client": "1.9.0",
"@solana/spl-token": "0.3.7",
"@solana/web3.js": "1.92.3",
"@types/bn.js": "5.1.5",
"@types/minimist": "1.2.5",
"@types/mocha": "10.0.6",
"async": "3.2.5",
"async-mutex": "0.3.2",
"aws-sdk": "2.1511.0",
"axios": "1.7.7",
"commander": "9.5.0",
"dotenv": "10.0.0",
"jito-ts": "4.1.1",
"lru-cache": "10.2.0",
"minimist": "1.2.8",
"rpc-websockets": "7.11.0",
"tweetnacl": "1.0.3",
"tweetnacl-util": "0.15.1",
"typescript": "4.5.4",
"undici": "6.19.2",
"winston": "3.11.0",
"ws": "8.18.0",
"yaml": "2.3.4"
},
"devDependencies": {
"@types/chai": "4.3.11",
"@types/mocha": "10.0.6",
"@typescript-eslint/eslint-plugin": "5.62.0",
"@typescript-eslint/parser": "4.33.0",
"chai": "4.3.10",
"eslint": "7.32.0",
"eslint-config-prettier": "8.10.0",
"eslint-plugin-prettier": "3.4.1",
"husky": "7.0.4",
"mocha": "10.2.0",
"prettier": "3.0.1",
"ts-node": "10.9.1"
},
"scripts": {
"prepare": "husky install",
"build": "yarn clean && tsc",
"clean": "rm -rf lib",
"start": "node lib/index.js",
"dev": "NODE_OPTIONS=--max-old-space-size=8192 ts-node src/index.ts",
"dev:inspect": "node --inspect --require ts-node/register src/index.ts",
"dev:filler": "ts-node src/index.ts --filler",
"dev:trigger": "ts-node src/index.ts --trigger",
"dev:jitmaker": "ts-node src/index.ts --jit-maker",
"dev:liquidator": "ts-node src/index.ts --liquidator",
"dev:pnlsettler": "ts-node src/index.ts --user-pnl-settler",
"dev-exp": "NODE_OPTIONS=--max-old-space-size=8192 ts-node src/experimental-bots/entrypoint.ts",
"dev-exp:inspect": "NODE_OPTIONS=--max-old-space-size=8192 node --inspect --require ts-node/register src/experimental-bots/entrypoint.ts",
"prettify": "prettier --check './src/**/*.ts'",
"prettify:fix": "prettier --write './src/**/*.ts'",
"lint": "eslint . --ext ts --quiet",
"lint:fix": "eslint . --ext ts --fix",
"example:restingLimitMaker": "ts-node market_making_examples/restingLimitMaker/index.ts",
"example:jitMaker": "ts-node market_making_examples/jitMaker/index.ts",
"test": "mocha -r ts-node/register ./src/**/*.test.ts"
},
"engines": {
"node": ">=20.18.0"
}
}
| 0
|
solana_public_repos/drift-labs
|
solana_public_repos/drift-labs/keeper-bots-v2/.prettierrc.js
|
module.exports = {
semi: true,
trailingComma: 'es5',
singleQuote: true,
printWidth: 80,
tabWidth: 2,
useTabs: true,
bracketSameLine: false,
};
| 0
|
solana_public_repos/drift-labs
|
solana_public_repos/drift-labs/keeper-bots-v2/tsconfig.json
|
{
"compilerOptions": {
"types": [
"mocha",
],
"module": "commonjs",
"target": "es2019",
"esModuleInterop": true,
"preserveConstEnums": true,
"sourceMap": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"baseUrl": ".",
"rootDirs": [
"src"
],
"outDir": "./lib",
"strict": true
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules",
"src/**/*.test.ts"
]
}
| 0
|
solana_public_repos/drift-labs
|
solana_public_repos/drift-labs/keeper-bots-v2/lite.config.yaml
|
global:
# devnet or mainnet-beta
driftEnv: mainnet-beta
# RPC endpoint to use
endpoint: https://api.mainnet-beta.solana.com
wsEndpoint:
# Private key to use to sign transactions.
# will load from KEEPER_PRIVATE_KEY env var if null
keeperPrivateKey:
initUser: false # initialize user on startup
testLiveness: false # test liveness, by failing liveness test after 1 min
# Force deposit this amount of USDC to collateral account, the program will
# end after the deposit transaction is sent
#forceDeposit: 1000
websocket: true # use websocket for account loading and events (limited support)
runOnce: false # Set true to run once and exit, useful for testing or one off bot runs
debug: false # Enable debug logging
# subaccountIDs to load, if null will load subaccount 0 (default).
# Even if bot specific configs requires subaccountIDs, you should still
# specify it here, since we load the subaccounts before loading individual
# bots.
# subaccounts:
# - 0
# - 1
# - 2
eventSubscriberPollingInterval: 0
bulkAccountLoaderPollingInterval: 0
useJito: false
# which subaccounts to load, if null will load subaccount 0 (default)
subaccounts:
# Which bots to run, be careful with this, running multiple bots in one instance
# might use more resources than expected.
# Bot specific configs are below
enabledBots:
# Perp order filler bot
# - fillerLite
# Spot order filler bot
# - spotFiller
# Trigger bot (triggers trigger orders)
# - trigger
# Liquidator bot, liquidates unhealthy positions by taking over the risk (caution, you should manage risk here)
# - liquidator
# Example maker bot that participates in JIT auction (caution: you will probably lose money)
# - jitMaker
# Example maker bot that posts floating oracle orders
# - floatingMaker
# settles PnLs for the insurance fund (may want to run with runOnce: true)
# - ifRevenueSettler
# settles negative PnLs for users (may want to run with runOnce: true)
# - userPnlSettler
- markTwapCrank
# below are bot configs
botConfigs:
fillerLite:
botId: "fillerLite"
dryRun: false
fillerPollingInterval: 500
metricsPort: 9464
# will revert a transaction during simulation if a fill fails, this will save on tx fees,
# and be friendlier for use with services like Jito.
# Default is true
markTwapCrank:
botId: "mark-twap-cranker"
dryRun: false
metricsPort: 9465
crankIntervalToMarketIndicies:
15000:
- 0
- 1
- 2
60000:
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
| 0
|
solana_public_repos/drift-labs
|
solana_public_repos/drift-labs/keeper-bots-v2/.env.example
|
KEEPER_PRIVATE_KEY=246,79,83,235,227,63,148,45,236,118,164,3,0,99,197,152,7,161,4,247,132,15,56,14,71,41,175,39,108,68,32,37,233,229,35,89,133,166,36,228,162,196,142,255,237,118,168,210,61,163,132,32,11,89,22,89,116,119,126,116,203,65,29,77
ENDPOINT=https://api.devnet.solana.com
ENV=devnet
| 0
|
solana_public_repos/drift-labs
|
solana_public_repos/drift-labs/keeper-bots-v2/.eslintrc.json
|
{
"root": true,
"parser": "@typescript-eslint/parser",
"env": {
"browser": true
},
"ignorePatterns": ["**/lib", "**/node_modules", "migrations", "**/scratch"],
"plugins": [],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": [
2,
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/no-empty-function": 0,
"no-mixed-spaces-and-tabs": [2, "smart-tabs"],
"no-prototype-builtins": "off",
"semi": 2
},
"settings": {
"react": {
"version": "detect"
}
}
}
| 0
|
solana_public_repos/drift-labs/keeper-bots-v2
|
solana_public_repos/drift-labs/keeper-bots-v2/.husky/post-merge
|
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
RED='\033[0;31m';
NC='\033[0m';
BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [[ "$BRANCH" = "master" ]]
then
if [[ $(grep -ciE "drift-labs/sdk.*beta.*" ./package.json) -eq 0 ]]
then
echo "$RED warning: on '$BRANCH' branch but not using a beta release of @drift-labs/sdk $NC"
fi
elif [[ "$BRANCH" = "mainnet-beta" ]]
then
if [[ $(grep -ciE "drift-labs/sdk.*beta.*" ./package.json) -gt 0 ]]
then
echo "$RED warning: on '$BRANCH' branch but using a beta release of @drift-labs/sdk$NC"
fi
fi
| 0
|
solana_public_repos/drift-labs/keeper-bots-v2
|
solana_public_repos/drift-labs/keeper-bots-v2/.husky/pre-commit
|
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
RED='\033[0;31m';
NC='\033[0m';
BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [[ "$BRANCH" = "master" ]]
then
if [[ $(grep -ciE "drift-labs/sdk.*beta.*" ./package.json) -eq 0 ]]
then
echo "$RED warning: on '$BRANCH' branch but not using a beta release of @drift-labs/sdk $NC"
fi
elif [[ "$BRANCH" = "mainnet-beta" ]]
then
if [[ $(grep -ciE "drift-labs/sdk.*beta.*" ./package.json) -gt 0 ]]
then
echo "$RED warning: on '$BRANCH' branch but using a beta release of @drift-labs/sdk$NC"
fi
fi
yarn prettify
yarn lint
yarn test
yarn build
| 0
|
solana_public_repos/drift-labs/keeper-bots-v2
|
solana_public_repos/drift-labs/keeper-bots-v2/src/pythPriceFeedSubscriber.ts
|
import {
PriceFeed,
PriceServiceConnection,
PriceServiceConnectionConfig,
} from '@pythnetwork/price-service-client';
export class PythPriceFeedSubscriber extends PriceServiceConnection {
protected latestPythVaas: Map<string, string> = new Map(); // priceFeedId -> vaa
constructor(endpoint: string, config: PriceServiceConnectionConfig) {
super(endpoint, config);
}
async subscribe(feedIds: string[]) {
await super.subscribePriceFeedUpdates(feedIds, (priceFeed: PriceFeed) => {
if (priceFeed.vaa) {
const priceFeedId = '0x' + priceFeed.id;
this.latestPythVaas.set(priceFeedId, priceFeed.vaa);
}
});
}
getLatestCachedVaa(feedId: string): string | undefined {
return this.latestPythVaas.get(feedId);
}
}
| 0
|
solana_public_repos/drift-labs/keeper-bots-v2
|
solana_public_repos/drift-labs/keeper-bots-v2/src/utils.test.ts
|
import { expect } from 'chai';
import { isSetComputeUnitsIx } from './utils';
import { ComputeBudgetProgram } from '@solana/web3.js';
describe('transaction simulation tests', () => {
it('isSetComputeUnitsIx', () => {
const cuLimitIx = ComputeBudgetProgram.setComputeUnitLimit({
units: 1_400_000,
});
const cuPriceIx = ComputeBudgetProgram.setComputeUnitPrice({
microLamports: 10_000,
});
expect(isSetComputeUnitsIx(cuLimitIx)).to.be.true;
expect(isSetComputeUnitsIx(cuPriceIx)).to.be.false;
});
});
| 0
|
solana_public_repos/drift-labs/keeper-bots-v2
|
solana_public_repos/drift-labs/keeper-bots-v2/src/types.test.ts
|
import { expect } from 'chai';
import { BN, isVariant } from '@drift-labs/sdk';
import { TwapExecutionProgress } from './types';
import { selectMakers } from './makerSelection';
import { MAX_MAKERS_PER_FILL } from './bots/filler';
describe('TwapExecutionProgress', () => {
const startTs = 1000;
it('should calculate correct execution direction and progress', () => {
let twap = new TwapExecutionProgress({
currentPosition: new BN(0),
targetPosition: new BN(10),
overallDurationSec: 10,
startTimeSec: startTs,
});
let remaining = twap.getAmountRemaining();
expect(remaining.toString()).to.be.equal(new BN(10).toString());
expect(isVariant(twap.getExecutionDirection(), 'long')).to.be.equal(true);
twap = new TwapExecutionProgress({
currentPosition: new BN(10),
targetPosition: new BN(0),
overallDurationSec: 10,
startTimeSec: startTs,
});
remaining = twap.getAmountRemaining();
expect(remaining.toString()).to.be.equal(new BN(10).toString());
expect(isVariant(twap.getExecutionDirection(), 'short')).to.be.equal(true);
twap = new TwapExecutionProgress({
currentPosition: new BN(-10),
targetPosition: new BN(30),
overallDurationSec: 10,
startTimeSec: startTs,
});
remaining = twap.getAmountRemaining();
expect(remaining.toString()).to.be.equal(new BN(40).toString());
expect(isVariant(twap.getExecutionDirection(), 'long')).to.be.equal(true);
twap = new TwapExecutionProgress({
currentPosition: new BN(10),
targetPosition: new BN(-30),
overallDurationSec: 10,
startTimeSec: startTs,
});
remaining = twap.getAmountRemaining();
expect(remaining.toString()).to.be.equal(new BN(40).toString());
expect(isVariant(twap.getExecutionDirection(), 'short')).to.be.equal(true);
});
it('should calculate execution slice correctly', () => {
let twap = new TwapExecutionProgress({
currentPosition: new BN(0),
targetPosition: new BN(10),
overallDurationSec: 10,
startTimeSec: startTs,
});
let slice = twap.getExecutionSlice(startTs + 1);
expect(slice.toString()).to.be.equal(new BN(1).toString());
twap = new TwapExecutionProgress({
currentPosition: new BN(-5000),
targetPosition: new BN(10000),
overallDurationSec: 300,
startTimeSec: startTs,
});
slice = twap.getExecutionSlice(startTs + 1);
expect(slice.toString()).to.be.equal(new BN(50).toString());
expect(isVariant(twap.getExecutionDirection(), 'long')).to.be.equal(true);
twap = new TwapExecutionProgress({
currentPosition: new BN(5000),
targetPosition: new BN(-10000),
overallDurationSec: 300,
startTimeSec: startTs,
});
slice = twap.getExecutionSlice(startTs + 1);
expect(slice.toString()).to.be.equal(new BN(50).toString());
expect(isVariant(twap.getExecutionDirection(), 'short')).to.be.equal(true);
});
it('should update progress and calculate execution slice correctly', () => {
// no flip
let twap = new TwapExecutionProgress({
currentPosition: new BN(0),
targetPosition: new BN(10),
overallDurationSec: 10,
startTimeSec: startTs,
});
let slice = twap.getExecutionSlice(startTs + 1);
expect(slice.toString()).to.be.equal(new BN(1).toString());
let remaining = twap.getAmountRemaining();
expect(remaining.toString()).to.be.equal(new BN(10).toString());
expect(isVariant(twap.getExecutionDirection(), 'long')).to.be.equal(true);
twap.updateProgress(new BN(1), startTs);
slice = twap.getExecutionSlice(startTs + 1);
twap.updateExecution(startTs + 1);
expect(slice.toString()).to.be.equal(new BN(1).toString());
remaining = twap.getAmountRemaining();
expect(remaining.toString()).to.be.equal(new BN(9).toString());
expect(isVariant(twap.getExecutionDirection(), 'long')).to.be.equal(true);
// flip short -> long
twap = new TwapExecutionProgress({
currentPosition: new BN(-5000),
targetPosition: new BN(10000),
overallDurationSec: 300,
startTimeSec: startTs,
});
slice = twap.getExecutionSlice(startTs + 1);
expect(slice.toString()).to.be.equal(new BN(50).toString());
remaining = twap.getAmountRemaining();
expect(remaining.toString()).to.be.equal(new BN(15000).toString());
expect(isVariant(twap.getExecutionDirection(), 'long')).to.be.equal(true);
twap.updateProgress(new BN(-4950), startTs + 1);
slice = twap.getExecutionSlice(startTs + 1);
twap.updateExecution(startTs + 2);
expect(slice.toString()).to.be.equal(new BN(50).toString());
remaining = twap.getAmountRemaining();
expect(remaining.toString()).to.be.equal(new BN(14950).toString());
expect(isVariant(twap.getExecutionDirection(), 'long')).to.be.equal(true);
// flip long -> short
twap = new TwapExecutionProgress({
currentPosition: new BN(5000),
targetPosition: new BN(-10000),
overallDurationSec: 300,
startTimeSec: startTs,
});
slice = twap.getExecutionSlice(startTs + 1);
expect(slice.toString()).to.be.equal(new BN(50).toString());
remaining = twap.getAmountRemaining();
expect(remaining.toString()).to.be.equal(new BN(15000).toString());
expect(isVariant(twap.getExecutionDirection(), 'short')).to.be.equal(true);
twap.updateProgress(new BN(4950), startTs + 1);
slice = twap.getExecutionSlice(startTs + 1);
twap.updateExecution(startTs + 1);
expect(slice.toString()).to.be.equal(new BN(50).toString());
remaining = twap.getAmountRemaining();
expect(remaining.toString()).to.be.equal(new BN(14950).toString());
expect(isVariant(twap.getExecutionDirection(), 'short')).to.be.equal(true);
// position increased while closing long
twap = new TwapExecutionProgress({
currentPosition: new BN(5000),
targetPosition: new BN(0),
overallDurationSec: 300,
startTimeSec: startTs,
});
slice = twap.getExecutionSlice(startTs + 1);
expect(slice.toString()).to.be.equal(new BN(16).toString());
remaining = twap.getAmountRemaining();
expect(remaining.toString()).to.be.equal(new BN(5000).toString());
expect(isVariant(twap.getExecutionDirection(), 'short')).to.be.equal(true);
// filled a bit
twap.updateProgress(new BN(4950), startTs + 1);
slice = twap.getExecutionSlice(startTs + 1);
twap.updateExecution(startTs + 1);
expect(slice.toString()).to.be.equal(new BN(16).toString());
remaining = twap.getAmountRemaining();
expect(remaining.toString()).to.be.equal(new BN(4950).toString());
expect(isVariant(twap.getExecutionDirection(), 'short')).to.be.equal(true);
// position got bigger
twap.updateProgress(new BN(5500), startTs + 1);
slice = twap.getExecutionSlice(startTs);
twap.updateExecution(startTs + 2);
expect(slice.toString()).to.be.equal(new BN(18).toString()); // should recalculate slice based on new larger position
remaining = twap.getAmountRemaining();
expect(remaining.toString()).to.be.equal(new BN(5500).toString());
expect(isVariant(twap.getExecutionDirection(), 'short')).to.be.equal(true);
});
it('should correctly size slice as time passes', () => {
// want to trade out of 1000 over 300s (5 min)
const twap = new TwapExecutionProgress({
currentPosition: new BN(1000),
targetPosition: new BN(0),
overallDurationSec: 300,
startTimeSec: startTs,
});
let slice = twap.getExecutionSlice(startTs + 0);
expect(slice.toString()).to.be.equal(new BN(0).toString());
slice = twap.getExecutionSlice(startTs + 100);
expect(slice.toString()).to.be.equal(new BN(333).toString());
slice = twap.getExecutionSlice(startTs + 150);
expect(slice.toString()).to.be.equal(new BN(500).toString());
slice = twap.getExecutionSlice(startTs + 300);
expect(slice.toString()).to.be.equal(new BN(1000).toString());
slice = twap.getExecutionSlice(startTs + 400);
expect(slice.toString()).to.be.equal(new BN(1000).toString());
});
it('should calculate correct execution for first slice of new init', () => {
const twap = new TwapExecutionProgress({
currentPosition: new BN(0),
targetPosition: new BN(0),
overallDurationSec: 3000, // 6 min
startTimeSec: startTs,
});
const remaining = twap.getAmountRemaining();
expect(remaining.toString()).to.be.equal(new BN(0).toString());
const startTs1 = startTs + 1000;
twap.updateProgress(new BN(300_000), startTs1); // 300_000 over 3000s, is 100 per second
let slice = twap.getExecutionSlice(startTs1);
twap.updateExecution(startTs1);
expect(slice.toString()).to.be.equal(new BN(100 * 1000).toString());
const startTs2 = startTs + 2000;
twap.updateProgress(new BN(200_000), startTs2);
slice = twap.getExecutionSlice(startTs2);
twap.updateExecution(startTs2);
expect(slice.toString()).to.be.equal(new BN(100 * 1000).toString());
const startTs3 = startTs + 3000;
twap.updateProgress(new BN(100_000), startTs3);
slice = twap.getExecutionSlice(startTs3);
twap.updateExecution(startTs3);
expect(slice.toString()).to.be.equal(new BN(100 * 1000).toString());
const startTs4 = startTs + 4000;
twap.updateProgress(new BN(0), startTs4);
slice = twap.getExecutionSlice(startTs4);
twap.updateExecution(startTs4);
expect(slice.toString()).to.be.equal(new BN(0).toString());
});
it('should correctly size slice as time passes with fills', () => {
// want to trade out of 1000 over 300s (5 min)
const twap = new TwapExecutionProgress({
currentPosition: new BN(1000),
targetPosition: new BN(0),
overallDurationSec: 300,
startTimeSec: startTs,
});
let slice = twap.getExecutionSlice(startTs + 0);
expect(slice.toString()).to.be.equal(new BN(0).toString());
slice = twap.getExecutionSlice(startTs + 100);
expect(slice.toString()).to.be.equal(new BN(333).toString());
slice = twap.getExecutionSlice(startTs + 150);
expect(slice.toString()).to.be.equal(new BN(500).toString());
// fill half
twap.updateProgress(new BN(500), startTs + 150);
slice = twap.getExecutionSlice(startTs + 150);
twap.updateExecution(startTs + 150);
slice = twap.getExecutionSlice(startTs + 150);
expect(slice.toString()).to.be.equal(new BN(0).toString());
slice = twap.getExecutionSlice(startTs + 300);
expect(slice.toString()).to.be.equal(new BN(500).toString());
twap.updateProgress(new BN(0), startTs + 300);
slice = twap.getExecutionSlice(startTs + 400);
twap.updateExecution(startTs + 400);
expect(slice.toString()).to.be.equal(new BN(0).toString());
});
});
describe('selectMakers', () => {
let originalRandom: { (): number; (): number };
beforeEach(() => {
// Mock Math.random
let seed = 12345;
originalRandom = Math.random;
Math.random = () => {
const x = Math.sin(seed++) * 10000;
return x - Math.floor(x);
};
});
afterEach(() => {
// Restore original Math.random
Math.random = originalRandom;
});
it('more than 6', function () {
// Mock DLOBNode and Order
const mockOrder = (filledAmount: number, orderId: number) => ({
orderId,
baseAssetAmount: new BN(100),
baseAssetAmountFilled: new BN(filledAmount),
});
const mockDLOBNode = (filledAmount: number, orderId: number) => ({
order: mockOrder(filledAmount, orderId),
// Include other necessary properties of DLOBNode if needed
});
const makerNodeMap = new Map([
['0', [mockDLOBNode(10, 0)]],
['1', [mockDLOBNode(20, 1)]],
['2', [mockDLOBNode(30, 2)]],
['3', [mockDLOBNode(40, 3)]],
['4', [mockDLOBNode(50, 4)]],
['5', [mockDLOBNode(60, 5)]],
['6', [mockDLOBNode(70, 6)]],
['7', [mockDLOBNode(80, 7)]],
['8', [mockDLOBNode(90, 8)]],
]);
// @ts-ignore
const selectedMakers = selectMakers(makerNodeMap);
expect(selectedMakers).to.not.be.undefined;
expect(selectedMakers.size).to.be.equal(MAX_MAKERS_PER_FILL);
expect(selectedMakers.get('0')).to.not.be.undefined;
expect(selectedMakers.get('1')).to.not.be.undefined;
expect(selectedMakers.get('2')).to.not.be.undefined;
expect(selectedMakers.get('3')).to.not.be.undefined;
expect(selectedMakers.get('4')).to.be.undefined;
expect(selectedMakers.get('5')).to.not.be.undefined;
expect(selectedMakers.get('6')).to.not.be.undefined;
expect(selectedMakers.get('7')).to.be.undefined;
expect(selectedMakers.get('8')).to.be.undefined;
});
});
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.