@depthhq/sdk 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account/confirm.d.ts +5 -0
- package/dist/account/discovery.d.ts +49 -0
- package/dist/account/funding.d.ts +86 -0
- package/dist/account/funding.js +498 -0
- package/dist/account/release.d.ts +8 -0
- package/dist/account/token.d.ts +5 -0
- package/dist/app/app.d.ts +50 -0
- package/dist/catalog/catalog.d.ts +50 -0
- package/dist/catalog/data.d.ts +30 -0
- package/dist/catalog/data.js +169 -0
- package/dist/chain/arcium.d.ts +10 -0
- package/dist/chain/connection.d.ts +4 -0
- package/dist/chain/environment.d.ts +20 -0
- package/dist/chain/manifest.d.ts +36 -0
- package/dist/chain/network.d.ts +18 -0
- package/dist/chain/provider.d.ts +6 -0
- package/dist/chain/random.d.ts +1 -0
- package/dist/chain/settlement.d.ts +15 -0
- package/dist/chain/transaction.d.ts +12 -0
- package/dist/client/client.d.ts +137 -0
- package/dist/client/types.d.ts +105 -0
- package/dist/history/history.d.ts +26 -0
- package/dist/history/replay.d.ts +13 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.js +47534 -0
- package/dist/operation/error.d.ts +10 -0
- package/dist/operation/operation.d.ts +49 -0
- package/dist/operator.d.ts +6 -0
- package/dist/operator.js +25383 -0
- package/dist/position/pnl.d.ts +14 -0
- package/dist/recovery/coordinator.d.ts +17 -0
- package/dist/recovery/recovery.d.ts +26 -0
- package/dist/recovery/recovery.js +1420 -0
- package/dist/recovery/shares.d.ts +26 -0
- package/dist/recovery/winddown.d.ts +38 -0
- package/dist/recovery/witness.d.ts +16 -0
- package/dist/trade/amount.d.ts +2 -0
- package/dist/trade/flow.d.ts +21 -0
- package/dist/trade/input.d.ts +3 -0
- package/dist/trade/terms.d.ts +3 -0
- package/dist/view/view.d.ts +59 -0
- package/dist/view/view.js +26681 -0
- package/package.json +52 -3
- package/README.md +0 -3
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type ErrorStage = "validation" | "submission" | "confirmation";
|
|
2
|
+
export declare class DepthError extends Error {
|
|
3
|
+
readonly code: string;
|
|
4
|
+
readonly stage: ErrorStage;
|
|
5
|
+
readonly retryable: boolean;
|
|
6
|
+
readonly nextAction: string;
|
|
7
|
+
readonly operationId?: string | undefined;
|
|
8
|
+
constructor(code: string, stage: ErrorStage, message: string, retryable: boolean, nextAction: string, operationId?: string | undefined, options?: ErrorOptions);
|
|
9
|
+
}
|
|
10
|
+
export declare function submissionError(operationId: string, cause: unknown): never;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as anchor from "@anchor-lang/core";
|
|
2
|
+
import type { OperationSnapshot } from "@depthhq/schema";
|
|
3
|
+
import { Connection, PublicKey } from "@solana/web3.js";
|
|
4
|
+
import type { DepthView, FillSnapshot, PositionSnapshot } from "../view/view.js";
|
|
5
|
+
import { type PositionPnl } from "../position/pnl.js";
|
|
6
|
+
import { type SettlementTransaction } from "../chain/settlement.js";
|
|
7
|
+
export declare class DepthOperation {
|
|
8
|
+
readonly id: PublicKey;
|
|
9
|
+
readonly signature: string | undefined;
|
|
10
|
+
private readonly program;
|
|
11
|
+
private readonly connection;
|
|
12
|
+
private readonly requestFillView?;
|
|
13
|
+
private readonly priorPosition?;
|
|
14
|
+
private readonly historicalPnl?;
|
|
15
|
+
private viewPromise?;
|
|
16
|
+
private view?;
|
|
17
|
+
private fill?;
|
|
18
|
+
private settlement?;
|
|
19
|
+
constructor(id: PublicKey, signature: string | undefined, program: anchor.Program, connection: Connection, requestFillView?: ((order: PublicKey) => Promise<DepthView>) | undefined, priorPosition?: PositionSnapshot | undefined, historicalPnl?: (() => Promise<PositionPnl>) | undefined);
|
|
20
|
+
transaction(): Promise<SettlementTransaction>;
|
|
21
|
+
pnl(): Promise<PositionPnl>;
|
|
22
|
+
private readOrder;
|
|
23
|
+
status(): Promise<OperationSnapshot>;
|
|
24
|
+
cancel(): Promise<OperationSnapshot>;
|
|
25
|
+
subscribe(listener: (snapshot: OperationSnapshot) => void | Promise<void>, options: {
|
|
26
|
+
pollMs?: number;
|
|
27
|
+
onError: (error: unknown) => void;
|
|
28
|
+
}): () => void;
|
|
29
|
+
wait(options?: {
|
|
30
|
+
timeoutMs?: number;
|
|
31
|
+
pollMs?: number;
|
|
32
|
+
signal?: AbortSignal;
|
|
33
|
+
}): Promise<OperationSnapshot>;
|
|
34
|
+
confirm(options?: {
|
|
35
|
+
timeoutMs?: number;
|
|
36
|
+
pollMs?: number;
|
|
37
|
+
signal?: AbortSignal;
|
|
38
|
+
}): Promise<{
|
|
39
|
+
orderId: PublicKey;
|
|
40
|
+
snapshot: OperationSnapshot;
|
|
41
|
+
}>;
|
|
42
|
+
privateResult(options?: {
|
|
43
|
+
timeoutMs?: number;
|
|
44
|
+
pollMs?: number;
|
|
45
|
+
}): Promise<FillSnapshot & {
|
|
46
|
+
positionId: PublicKey;
|
|
47
|
+
}>;
|
|
48
|
+
private cleanupError;
|
|
49
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { WinddownOperator } from "./recovery/winddown.js";
|
|
2
|
+
export { createRecoveryShares, openRecoveryShare, combineRecoveryShares, } from "./recovery/shares.js";
|
|
3
|
+
export type { RecoveryEnvelope, RecoveryShare } from "./recovery/shares.js";
|
|
4
|
+
export { RecoveryWitnessReader } from "./recovery/witness.js";
|
|
5
|
+
export { RecoveryCoordinator } from "./recovery/coordinator.js";
|
|
6
|
+
export type { ClearingWitness, MarketWitness, FeeWitness, } from "./recovery/winddown.js";
|