@pooflabs/core 0.0.38 → 0.0.39
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/client/operations.d.ts +30 -30
- package/dist/index.d.ts +1 -1
- package/dist/index.js +90 -56
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +90 -57
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils/api.d.ts +2 -0
- package/dist/utils/server-session-manager.d.ts +12 -3
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export interface SolTransaction {
|
|
|
41
41
|
lutKey: PublicKey | null;
|
|
42
42
|
network: string;
|
|
43
43
|
preInstructions: TransactionInstruction[];
|
|
44
|
-
/** Base64-encoded VersionedTransaction
|
|
44
|
+
/** Base64-encoded VersionedTransaction prebuilt server-side for sponsorship and/or required co-signers. */
|
|
45
45
|
signedTransaction?: string;
|
|
46
46
|
}
|
|
47
47
|
export interface TransactionResult {
|
package/dist/utils/api.d.ts
CHANGED
|
@@ -5,4 +5,6 @@ declare global {
|
|
|
5
5
|
}
|
|
6
6
|
export declare function makeApiRequest(method: string, urlPath: string, data?: any, _overrides?: {
|
|
7
7
|
headers?: Record<string, string>;
|
|
8
|
+
_getAuthHeaders?: () => Promise<Record<string, string>>;
|
|
9
|
+
_clearAuth?: () => Promise<void>;
|
|
8
10
|
}): Promise<any>;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { Keypair } from "@solana/web3.js";
|
|
1
2
|
/**
|
|
2
3
|
* Server-side SessionManager
|
|
3
4
|
* --------------------------
|
|
4
|
-
* •
|
|
5
|
-
* •
|
|
5
|
+
* • Default singleton via `ServerSessionManager.instance` (reads keypair from env)
|
|
6
|
+
* • Per-keypair instances via `ServerSessionManager.forKeypair(kp)`
|
|
7
|
+
* • Keeps session data in-memory for the life of the instance
|
|
6
8
|
* • If `getSession()` finds no cached session it calls `createSession()`
|
|
7
|
-
* to obtain fresh tokens
|
|
9
|
+
* to obtain fresh tokens.
|
|
8
10
|
*/
|
|
9
11
|
export interface ServerSession {
|
|
10
12
|
address: string;
|
|
@@ -16,7 +18,14 @@ export declare class ServerSessionManager {
|
|
|
16
18
|
static readonly instance: ServerSessionManager;
|
|
17
19
|
private session;
|
|
18
20
|
private pendingSession;
|
|
21
|
+
private readonly keypair;
|
|
19
22
|
private constructor();
|
|
23
|
+
/**
|
|
24
|
+
* Create a session manager for a specific keypair.
|
|
25
|
+
* Each instance has its own independent session cache.
|
|
26
|
+
*/
|
|
27
|
+
static forKeypair(keypair: Keypair): ServerSessionManager;
|
|
28
|
+
private createSession;
|
|
20
29
|
getSession(): Promise<ServerSession>;
|
|
21
30
|
setSession(session: ServerSession): void;
|
|
22
31
|
clearSession(): void;
|