@lightconexyz/lightcone-sdk 0.8.3-rc.49 → 0.8.3-rc.51
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/README.md +96 -7
- package/dist/client.d.ts +20 -5
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +38 -4
- package/dist/client.js.map +1 -1
- package/dist/context.d.ts +18 -48
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +56 -245
- package/dist/context.js.map +1 -1
- package/dist/domain/order/client.d.ts +5 -4
- package/dist/domain/order/client.d.ts.map +1 -1
- package/dist/domain/order/client.js +7 -7
- package/dist/domain/order/client.js.map +1 -1
- package/dist/domain/orderbook/client.d.ts +4 -5
- package/dist/domain/orderbook/client.d.ts.map +1 -1
- package/dist/domain/orderbook/client.js +3 -10
- package/dist/domain/orderbook/client.js.map +1 -1
- package/dist/domain/position/builders.d.ts +15 -52
- package/dist/domain/position/builders.d.ts.map +1 -1
- package/dist/domain/position/builders.js +35 -132
- package/dist/domain/position/builders.js.map +1 -1
- package/dist/domain/position/client.d.ts +14 -20
- package/dist/domain/position/client.d.ts.map +1 -1
- package/dist/domain/position/client.js +70 -84
- package/dist/domain/position/client.js.map +1 -1
- package/dist/error.d.ts +10 -3
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js +16 -3
- package/dist/error.js.map +1 -1
- package/dist/prelude.d.ts +4 -1
- package/dist/prelude.d.ts.map +1 -1
- package/dist/prelude.js +5 -3
- package/dist/prelude.js.map +1 -1
- package/dist/privy/client.d.ts +2 -5
- package/dist/privy/client.d.ts.map +1 -1
- package/dist/privy/client.js +4 -11
- package/dist/privy/client.js.map +1 -1
- package/dist/program/accounts.d.ts +10 -3
- package/dist/program/accounts.d.ts.map +1 -1
- package/dist/program/accounts.js +44 -9
- package/dist/program/accounts.js.map +1 -1
- package/dist/program/constants.d.ts +8 -12
- package/dist/program/constants.d.ts.map +1 -1
- package/dist/program/constants.js +9 -13
- package/dist/program/constants.js.map +1 -1
- package/dist/program/error.d.ts +7 -5
- package/dist/program/error.d.ts.map +1 -1
- package/dist/program/error.js +12 -10
- package/dist/program/error.js.map +1 -1
- package/dist/program/index.d.ts +8 -6
- package/dist/program/index.d.ts.map +1 -1
- package/dist/program/index.js +12 -18
- package/dist/program/index.js.map +1 -1
- package/dist/program/instructions.d.ts +91 -225
- package/dist/program/instructions.d.ts.map +1 -1
- package/dist/program/instructions.js +233 -413
- package/dist/program/instructions.js.map +1 -1
- package/dist/program/pda.d.ts +0 -14
- package/dist/program/pda.d.ts.map +1 -1
- package/dist/program/pda.js +0 -20
- package/dist/program/pda.js.map +1 -1
- package/dist/program/transaction.d.ts +55 -0
- package/dist/program/transaction.d.ts.map +1 -0
- package/dist/program/transaction.js +354 -0
- package/dist/program/transaction.js.map +1 -0
- package/dist/program/types.d.ts +19 -71
- package/dist/program/types.d.ts.map +1 -1
- package/dist/program/types.js.map +1 -1
- package/dist/program/utils.d.ts +2 -0
- package/dist/program/utils.d.ts.map +1 -1
- package/dist/program/utils.js +10 -0
- package/dist/program/utils.js.map +1 -1
- package/dist/rpc.d.ts +32 -12
- package/dist/rpc.d.ts.map +1 -1
- package/dist/rpc.js +186 -19
- package/dist/rpc.js.map +1 -1
- package/dist/rpcFailover.d.ts.map +1 -1
- package/dist/rpcFailover.js +4 -0
- package/dist/rpcFailover.js.map +1 -1
- package/dist/shared/signing.d.ts +3 -1
- package/dist/shared/signing.d.ts.map +1 -1
- package/dist/shared/signing.js +2 -1
- package/dist/shared/signing.js.map +1 -1
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -17,6 +17,7 @@ TypeScript SDK for the Lightcone impact market protocol on Solana.
|
|
|
17
17
|
- [Environment Configuration](#environment-configuration)
|
|
18
18
|
- [Examples](#examples)
|
|
19
19
|
- [Error Handling](#error-handling)
|
|
20
|
+
- [Solana v1 transactions](#solana-v1-transactions)
|
|
20
21
|
- [Transaction Fee Funding](#transaction-fee-funding)
|
|
21
22
|
- [Retry Strategy](#retry-strategy)
|
|
22
23
|
|
|
@@ -26,6 +27,83 @@ TypeScript SDK for the Lightcone impact market protocol on Solana.
|
|
|
26
27
|
npm install @lightconexyz/lightcone-sdk
|
|
27
28
|
```
|
|
28
29
|
|
|
30
|
+
## Solana v1 transactions
|
|
31
|
+
|
|
32
|
+
All transaction builders and submission methods now use `V1Transaction`. Legacy
|
|
33
|
+
and v0 envelopes are rejected. Instruction builders still return web3.js
|
|
34
|
+
`TransactionInstruction`, and addresses remain web3.js `PublicKey` values.
|
|
35
|
+
The official `@solana/kit` 8.0.0 codec owns v1 wire serialization.
|
|
36
|
+
|
|
37
|
+
Configure explicit resources before using fluent submission or SOL planners:
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
const client = LightconeClient.builder()
|
|
41
|
+
.nativeSigner(keypair)
|
|
42
|
+
.transactionResources({
|
|
43
|
+
computeUnitLimit: 200_000, // choose the limit for this workload
|
|
44
|
+
loadedAccountsDataSizeLimit: 65_536, // bytes
|
|
45
|
+
priorityFeeLamports: 0n, // total lamports, not a CU price
|
|
46
|
+
})
|
|
47
|
+
.build();
|
|
48
|
+
const context = await client.transactionContext();
|
|
49
|
+
const tx = client.positions().depositToGlobal()
|
|
50
|
+
.user(keypair.publicKey).mint(mint).amount(1_000_000n)
|
|
51
|
+
.buildTx(context);
|
|
52
|
+
const confirmed = await client.signAndSubmitTxConfirmedWithSlot(tx);
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`client.transactionContextWithResources(resources)` supplies limits for one
|
|
56
|
+
context. Direct `build*Tx` instruction helpers take a required context before the
|
|
57
|
+
optional program ID; domain `*Tx` methods and fluent `buildTx` take it last.
|
|
58
|
+
Use `V1Transaction.compile(instructions, payer, context)` to compose instructions.
|
|
59
|
+
Resources have no SDK defaults: compute units must be 1–1,400,000, loaded account
|
|
60
|
+
data 1–67,108,864 bytes, optional heap 32–256 KiB in 1-KiB increments, and priority
|
|
61
|
+
fees unsigned 64-bit `bigint` total lamports. Context expiry heights are exact
|
|
62
|
+
positive safe integers returned alongside their blockhash.
|
|
63
|
+
|
|
64
|
+
The transaction owns its immutable message and includes every required signature
|
|
65
|
+
slot when enforcing the 4,096-byte limit. It supports at most 64 distinct addresses,
|
|
66
|
+
12 signers, and 64 instructions. ComputeBudget instructions and address lookup
|
|
67
|
+
tables are unsupported. Split large account-initialization requests into batches;
|
|
68
|
+
an instruction valid by itself can exceed a transaction's account or byte limit.
|
|
69
|
+
`toWireBytes()` and `messageBytes()` return copies. `sign([keypair, ...])` returns a
|
|
70
|
+
new transaction; `fromWireBytes(bytes, context)` validates canonical imports.
|
|
71
|
+
|
|
72
|
+
Wallet adapters must implement `ExternalSigner.signTransaction` with v1 byte
|
|
73
|
+
support, return every required valid Ed25519 signature, and preserve the exact
|
|
74
|
+
message, including resources, fee payer, accounts, instructions, and blockhash.
|
|
75
|
+
Unsponsored external signers must report their `walletAddress`. Both shared and
|
|
76
|
+
raw Privy transaction methods fail before network activity because the current
|
|
77
|
+
Privy sign-and-send endpoint cannot expose its signed bytes for validation; use
|
|
78
|
+
an `ExternalSigner` that returns signed v1 bytes. Privy off-chain orders remain
|
|
79
|
+
available.
|
|
80
|
+
|
|
81
|
+
Before prompting a wallet the SDK checks the cluster's v1 feature activation.
|
|
82
|
+
Submission verifies all signatures, checks activation again, simulates the exact
|
|
83
|
+
signed bytes with `sigVerify: true` and `replaceRecentBlockhash: false`, then sends
|
|
84
|
+
once with preflight enabled and `maxRetries: 0`. There is no send retry or RPC
|
|
85
|
+
failover. Definite request or preflight rejections return `SubmissionRejected`
|
|
86
|
+
with `signature` and `rpcCode`. `AlreadyProcessed` and uncertain sends return
|
|
87
|
+
`SubmissionUnknown`, preserving `signature` and `lastValidBlockHeight` for
|
|
88
|
+
reconciliation. Confirmation uses the original expiry for ordinary and prepared
|
|
89
|
+
transactions. Rebuild and obtain new signatures when the message or budget changes;
|
|
90
|
+
a timeout or expired status does not authorize automatic resubmission.
|
|
91
|
+
|
|
92
|
+
Canonical v1 RPC uses a direct `fetch` transport to avoid web3.js's internal
|
|
93
|
+
rate-limit retry. Fee estimation, feature checks, and simulation use read-only
|
|
94
|
+
retry and failover with their exact parameters. Sends use one HTTP attempt.
|
|
95
|
+
Use `.rpcFetch(customFetch)` on the builder when RPC access needs custom headers or
|
|
96
|
+
a transport override. The supplied transport must also avoid resending requests.
|
|
97
|
+
Existing account reads and confirmation retain their read-only failover behavior.
|
|
98
|
+
|
|
99
|
+
Legacy `Connection`
|
|
100
|
+
constructor headers/middleware are not copied into the v1 transport; configure
|
|
101
|
+
v1 authentication in `rpcFetch`, including when supplying your own Connection.
|
|
102
|
+
SDK-managed connections (including clones and backups) share that fetch for
|
|
103
|
+
blockhash acquisition and other reads.
|
|
104
|
+
|
|
105
|
+
See the [cross-language transaction ADR](../docs/adr/0004-solana-v1.md).
|
|
106
|
+
|
|
29
107
|
## Transaction Fee Funding
|
|
30
108
|
|
|
31
109
|
Shared on-chain submission checks the exact prepared message fee and declared
|
|
@@ -38,11 +116,10 @@ actions retain fail-closed live fee, rent, and reserve checks.
|
|
|
38
116
|
|
|
39
117
|
`LightconeClient.builder().transactionSponsorship(true)` and
|
|
40
118
|
`client.setTransactionSponsorshipEnabled(true)` are trusted application assertions
|
|
41
|
-
for wallet-adapter
|
|
119
|
+
for wallet-adapter transaction signing. The default is false, each transaction
|
|
42
120
|
captures its signer and capability before asynchronous RPC work, `clone()` copies
|
|
43
|
-
the current value, and local-keypair submission rejects an enabled capability.
|
|
44
|
-
|
|
45
|
-
this contract.
|
|
121
|
+
the current value, and local-keypair submission rejects an enabled capability. Off-chain order-message signing is outside this contract. Privy transaction
|
|
122
|
+
submission is unavailable until signed v1 bytes can be verified.
|
|
46
123
|
|
|
47
124
|
## Quick Start
|
|
48
125
|
|
|
@@ -57,6 +134,11 @@ import {
|
|
|
57
134
|
async function main() {
|
|
58
135
|
const client = LightconeClient.builder()
|
|
59
136
|
.depositSource(DepositSource.Market)
|
|
137
|
+
.transactionResources({
|
|
138
|
+
computeUnitLimit: 200_000,
|
|
139
|
+
loadedAccountsDataSizeLimit: 65_536,
|
|
140
|
+
priorityFeeLamports: 0n,
|
|
141
|
+
})
|
|
60
142
|
.build();
|
|
61
143
|
const keypair = Keypair.generate();
|
|
62
144
|
|
|
@@ -346,7 +428,8 @@ await client.orders().cancel({
|
|
|
346
428
|
### Step 6: Exit a Position
|
|
347
429
|
|
|
348
430
|
```typescript
|
|
349
|
-
//
|
|
431
|
+
// Uses the explicit transaction resources configured on the client.
|
|
432
|
+
// The signature means RPC acceptance; confirm before dependent account operations.
|
|
350
433
|
const txHash = await client.positions().merge()
|
|
351
434
|
.user(keypair.publicKey)
|
|
352
435
|
.market(market)
|
|
@@ -485,7 +568,7 @@ All examples are runnable with `npx tsx examples/<name>.ts`. Examples default to
|
|
|
485
568
|
|---------|-------------|
|
|
486
569
|
| [`read_onchain`](examples/read_onchain.ts) | Read exchange state, market state, user nonce, and PDA derivations via RPC |
|
|
487
570
|
| [`onchain_transactions`](examples/onchain_transactions.ts) | Build, sign, and submit mint/merge complete set and increment nonce on-chain |
|
|
488
|
-
| [`global_deposit_withdrawal`](examples/global_deposit_withdrawal.ts) |
|
|
571
|
+
| [`global_deposit_withdrawal`](examples/global_deposit_withdrawal.ts) | Deposit to the global pool, move collateral into a market, withdraw from global, and merge the complete set back |
|
|
489
572
|
|
|
490
573
|
Every instruction builder appends the program's event transport trailer (the
|
|
491
574
|
event-authority PDA, then the program account) automatically, and public
|
|
@@ -519,11 +602,17 @@ All SDK operations reject with `SdkError`:
|
|
|
519
602
|
| `Http` | REST request failures |
|
|
520
603
|
| `Ws` | WebSocket connection/protocol errors |
|
|
521
604
|
| `Auth` | Authentication failures |
|
|
522
|
-
| `Validation` |
|
|
605
|
+
| `Validation` | Invalid v1 resources/messages, unsupported cluster or wallet capabilities, and domain conversion failures |
|
|
606
|
+
| `InsufficientSolForTransactionFees` | Proven fee-payer shortfall, with exact available and required lamports |
|
|
523
607
|
| `Serde` | Serialization errors |
|
|
524
608
|
| `MissingMarketContext` | Market context not provided for an operation requiring `DepositSource.Market` |
|
|
525
609
|
| `Signing` | Signing operation failures |
|
|
526
610
|
| `UserCancelled` | User cancelled wallet signing prompt |
|
|
611
|
+
| `SubmissionRejected` | RPC rejected the request or preflight before queuing; inspect `signature`, `rpcCode`, and the error message |
|
|
612
|
+
| `SubmissionUnknown` | Send outcome is uncertain; inspect `signature` and `lastValidBlockHeight` before rebuilding |
|
|
613
|
+
| `TransactionFailed` | Transaction confirmed with an on-chain error |
|
|
614
|
+
| `TransactionExpired` | Expiry is past and final history evidence has no signature; reconcile before rebuilding |
|
|
615
|
+
| `ConfirmationTimeout` | Confirmation could not establish the outcome |
|
|
527
616
|
| `ApiRejected` | Backend rejected the request (see [API Rejections](#api-rejections)) |
|
|
528
617
|
| `Program` | On-chain program errors (RPC, account parsing) |
|
|
529
618
|
| `Other` | Catch-all |
|
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { V1Transaction, type V1ResourceConfig, type V1TransactionContext } from "./program/transaction";
|
|
2
|
+
import { Connection, Keypair, PublicKey } from "@solana/web3.js";
|
|
2
3
|
import { Auth, type AuthCredentials } from "./auth";
|
|
3
4
|
import type { ClientContext } from "./context";
|
|
4
5
|
import type { ConfirmedTransaction } from "./context";
|
|
@@ -28,6 +29,8 @@ declare class AuthState {
|
|
|
28
29
|
clearCaches(): Promise<void>;
|
|
29
30
|
}
|
|
30
31
|
export declare class LightconeClient implements ClientContext {
|
|
32
|
+
readonly transactionResources?: V1ResourceConfig;
|
|
33
|
+
readonly rpcFetch?: typeof fetch;
|
|
31
34
|
readonly http: LightconeHttp;
|
|
32
35
|
readonly programId: PublicKey;
|
|
33
36
|
readonly primaryConnection?: Connection;
|
|
@@ -52,6 +55,8 @@ export declare class LightconeClient implements ClientContext {
|
|
|
52
55
|
depositSource?: DepositSource;
|
|
53
56
|
signingStrategy?: SigningStrategy;
|
|
54
57
|
transactionSponsorshipEnabled?: boolean;
|
|
58
|
+
transactionResources?: V1ResourceConfig;
|
|
59
|
+
rpcFetch?: typeof fetch;
|
|
55
60
|
orderNonce?: number;
|
|
56
61
|
authCredentials?: AuthCredentials;
|
|
57
62
|
authState?: AuthState;
|
|
@@ -102,21 +107,25 @@ export declare class LightconeClient implements ClientContext {
|
|
|
102
107
|
setCredentialRestorer(restorer: CredentialRestorer): void;
|
|
103
108
|
/** Remove the credential restorer (e.g. in tests); 401s propagate again. */
|
|
104
109
|
clearCredentialRestorer(): void;
|
|
105
|
-
|
|
110
|
+
/** Fetch a fresh context with configured v1 transaction resources. */
|
|
111
|
+
transactionContext(): Promise<V1TransactionContext>;
|
|
112
|
+
/** Fetch a fresh context with explicit limits and total priority fee lamports. */
|
|
113
|
+
transactionContextWithResources(resources: V1ResourceConfig): Promise<V1TransactionContext>;
|
|
114
|
+
signAndSubmitTx(tx: V1Transaction): Promise<string>;
|
|
106
115
|
/**
|
|
107
116
|
* Sign and submit a transaction, then wait until it reaches `confirmed`
|
|
108
117
|
* commitment on-chain. Prefer this over {@link signAndSubmitTx} when a
|
|
109
118
|
* follow-up transaction depends on this one's state.
|
|
110
119
|
*/
|
|
111
|
-
signAndSubmitTxConfirmed(tx:
|
|
120
|
+
signAndSubmitTxConfirmed(tx: V1Transaction): Promise<string>;
|
|
112
121
|
/** Sign, submit, confirm, and return the transaction's processing slot. */
|
|
113
|
-
signAndSubmitTxConfirmedWithSlot(tx:
|
|
122
|
+
signAndSubmitTxConfirmedWithSlot(tx: V1Transaction): Promise<ConfirmedTransaction>;
|
|
114
123
|
/**
|
|
115
124
|
* Sign, submit, and confirm a fee-prepared transaction without replacing its
|
|
116
125
|
* message. Privy and wallet-adapter message mutation are rejected. A confirmation
|
|
117
126
|
* timeout leaves the outcome unknown; inspect authoritative state before retrying.
|
|
118
127
|
*/
|
|
119
|
-
signAndSubmitPreparedTxConfirmedWithSlot(tx:
|
|
128
|
+
signAndSubmitPreparedTxConfirmedWithSlot(tx: V1Transaction): Promise<ConfirmedTransaction>;
|
|
120
129
|
static builder(): LightconeClientBuilder;
|
|
121
130
|
markets(): Markets;
|
|
122
131
|
orderbooks(): Orderbooks;
|
|
@@ -159,6 +168,8 @@ export declare class LightconeClientBuilder {
|
|
|
159
168
|
private depositSourceValue;
|
|
160
169
|
private signingStrategyValue?;
|
|
161
170
|
private transactionSponsorshipEnabledValue;
|
|
171
|
+
private transactionResourcesValue?;
|
|
172
|
+
private rpcFetchValue?;
|
|
162
173
|
private primaryRpcUrlValue?;
|
|
163
174
|
private backupRpcUrlValue?;
|
|
164
175
|
/**
|
|
@@ -182,6 +193,10 @@ export declare class LightconeClientBuilder {
|
|
|
182
193
|
privyWalletId(walletId: string, walletAddress?: string): LightconeClientBuilder;
|
|
183
194
|
/** Set the initial trusted Transaction Sponsorship Capability; defaults to false. */
|
|
184
195
|
transactionSponsorship(enabled: boolean): LightconeClientBuilder;
|
|
196
|
+
/** Set explicit v1 limits and total priority fee lamports for fluent builders and SOL plans. */
|
|
197
|
+
transactionResources(resources: V1ResourceConfig): LightconeClientBuilder;
|
|
198
|
+
/** Set the one-attempt fetch transport for v1 RPC, for example to add RPC authentication headers. */
|
|
199
|
+
rpcFetch(transport: typeof fetch): LightconeClientBuilder;
|
|
185
200
|
rpcUrl(url: string): LightconeClientBuilder;
|
|
186
201
|
/** Set a backup Solana RPC URL for automatic failover. */
|
|
187
202
|
backupRpcUrl(url: string): LightconeClientBuilder;
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAEb,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EAC1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
|
package/dist/client.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LightconeClientBuilder = exports.LightconeClient = void 0;
|
|
4
|
+
const transaction_1 = require("./program/transaction");
|
|
4
5
|
const web3_js_1 = require("@solana/web3.js");
|
|
5
6
|
const auth_1 = require("./auth");
|
|
6
7
|
const context_1 = require("./context");
|
|
@@ -36,6 +37,8 @@ class AuthState {
|
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
class LightconeClient {
|
|
40
|
+
transactionResources;
|
|
41
|
+
rpcFetch;
|
|
39
42
|
http;
|
|
40
43
|
programId;
|
|
41
44
|
primaryConnection;
|
|
@@ -53,6 +56,12 @@ class LightconeClient {
|
|
|
53
56
|
return this.primaryConnection;
|
|
54
57
|
}
|
|
55
58
|
constructor(params) {
|
|
59
|
+
if (params.transactionResources)
|
|
60
|
+
(0, transaction_1.validateV1Resources)(params.transactionResources);
|
|
61
|
+
this.transactionResources = params.transactionResources
|
|
62
|
+
? Object.freeze({ ...params.transactionResources })
|
|
63
|
+
: undefined;
|
|
64
|
+
this.rpcFetch = params.rpcFetch;
|
|
56
65
|
this.http = params.http;
|
|
57
66
|
this.programId = params.programId ?? (0, env_1.programId)(env_1.LightconeEnv.Prod);
|
|
58
67
|
this.primaryConnection = params.primaryConnection;
|
|
@@ -149,6 +158,14 @@ class LightconeClient {
|
|
|
149
158
|
clearCredentialRestorer() {
|
|
150
159
|
this.http.clearCredentialRestorer();
|
|
151
160
|
}
|
|
161
|
+
/** Fetch a fresh context with configured v1 transaction resources. */
|
|
162
|
+
transactionContext() {
|
|
163
|
+
return this.rpc().transactionContext();
|
|
164
|
+
}
|
|
165
|
+
/** Fetch a fresh context with explicit limits and total priority fee lamports. */
|
|
166
|
+
transactionContextWithResources(resources) {
|
|
167
|
+
return this.rpc().transactionContextWithResources(resources);
|
|
168
|
+
}
|
|
152
169
|
// ── Transaction signing + submission ────────────────────────────────
|
|
153
170
|
async signAndSubmitTx(tx) {
|
|
154
171
|
return (0, context_1.signAndSubmitTx)(this, tx);
|
|
@@ -248,15 +265,17 @@ class LightconeClient {
|
|
|
248
265
|
wsConfig: { ...this.wsConfigValue },
|
|
249
266
|
programId: this.programId,
|
|
250
267
|
primaryConnection: this.primaryConnection
|
|
251
|
-
? new web3_js_1.Connection(this.primaryConnection.rpcEndpoint, { commitment: "confirmed" })
|
|
268
|
+
? new web3_js_1.Connection(this.primaryConnection.rpcEndpoint, { commitment: "confirmed", fetch: this.rpcFetch })
|
|
252
269
|
: undefined,
|
|
253
270
|
backupConnection: this.backupConnection
|
|
254
|
-
? new web3_js_1.Connection(this.backupConnection.rpcEndpoint, { commitment: "confirmed" })
|
|
271
|
+
? new web3_js_1.Connection(this.backupConnection.rpcEndpoint, { commitment: "confirmed", fetch: this.rpcFetch })
|
|
255
272
|
: undefined,
|
|
256
273
|
rpcFailoverState: this.rpcFailoverState,
|
|
257
274
|
depositSource: this.depositSourceValue,
|
|
258
275
|
signingStrategy: this.signingStrategyValue,
|
|
259
276
|
transactionSponsorshipEnabled: this.transactionSponsorshipEnabledValue,
|
|
277
|
+
transactionResources: this.transactionResources,
|
|
278
|
+
rpcFetch: this.rpcFetch,
|
|
260
279
|
orderNonce: this.orderNonceValue,
|
|
261
280
|
authState: this.authStateStore,
|
|
262
281
|
orderbookRulesCache: this.orderbookRulesCache,
|
|
@@ -272,6 +291,8 @@ class LightconeClientBuilder {
|
|
|
272
291
|
depositSourceValue = shared_1.DepositSource.Global;
|
|
273
292
|
signingStrategyValue;
|
|
274
293
|
transactionSponsorshipEnabledValue = false;
|
|
294
|
+
transactionResourcesValue;
|
|
295
|
+
rpcFetchValue;
|
|
275
296
|
primaryRpcUrlValue = (0, env_1.rpcUrl)(env_1.LightconeEnv.Prod);
|
|
276
297
|
backupRpcUrlValue;
|
|
277
298
|
/**
|
|
@@ -334,6 +355,17 @@ class LightconeClientBuilder {
|
|
|
334
355
|
this.transactionSponsorshipEnabledValue = enabled;
|
|
335
356
|
return this;
|
|
336
357
|
}
|
|
358
|
+
/** Set explicit v1 limits and total priority fee lamports for fluent builders and SOL plans. */
|
|
359
|
+
transactionResources(resources) {
|
|
360
|
+
(0, transaction_1.validateV1Resources)(resources);
|
|
361
|
+
this.transactionResourcesValue = Object.freeze({ ...resources });
|
|
362
|
+
return this;
|
|
363
|
+
}
|
|
364
|
+
/** Set the one-attempt fetch transport for v1 RPC, for example to add RPC authentication headers. */
|
|
365
|
+
rpcFetch(transport) {
|
|
366
|
+
this.rpcFetchValue = transport;
|
|
367
|
+
return this;
|
|
368
|
+
}
|
|
337
369
|
rpcUrl(url) {
|
|
338
370
|
this.primaryRpcUrlValue = url;
|
|
339
371
|
return this;
|
|
@@ -359,11 +391,13 @@ class LightconeClientBuilder {
|
|
|
359
391
|
signingStrategy: this.signingStrategyValue,
|
|
360
392
|
transactionSponsorshipEnabled: this.transactionSponsorshipEnabledValue,
|
|
361
393
|
primaryConnection: this.primaryRpcUrlValue
|
|
362
|
-
? new web3_js_1.Connection(this.primaryRpcUrlValue, { commitment: "confirmed" })
|
|
394
|
+
? new web3_js_1.Connection(this.primaryRpcUrlValue, { commitment: "confirmed", fetch: this.rpcFetchValue })
|
|
363
395
|
: undefined,
|
|
364
396
|
backupConnection: this.backupRpcUrlValue
|
|
365
|
-
? new web3_js_1.Connection(this.backupRpcUrlValue, { commitment: "confirmed" })
|
|
397
|
+
? new web3_js_1.Connection(this.backupRpcUrlValue, { commitment: "confirmed", fetch: this.rpcFetchValue })
|
|
366
398
|
: undefined,
|
|
399
|
+
transactionResources: this.transactionResourcesValue,
|
|
400
|
+
rpcFetch: this.rpcFetchValue,
|
|
367
401
|
authCredentials: this.authCredentials,
|
|
368
402
|
});
|
|
369
403
|
}
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"m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B,EAAE,KAAK;gBAC3B,cAAc,EAAE,MAAM;gBACtB,aAAa,EAAE,MAAM;aACtB;YACD,SAAS,EAAE,IAAI,CAAC,cAAc;YAC9B,aAAa,EAAE,IAAI,CAAC,kBAAkB;YACtC,eAAe,EAAE,IAAI,CAAC,oBAAoB;YAC1C,6BAA6B,EAAE,IAAI,CAAC,kCAAkC;YACtE,iBAAiB,EAAE,IAAI,CAAC,kBAAkB;gBACxC,CAAC,CAAC,IAAI,oBAAU,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;gBACtE,CAAC,CAAC,SAAS;YACb,gBAAgB,EAAE,IAAI,CAAC,iBAAiB;gBACtC,CAAC,CAAC,IAAI,oBAAU,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;gBACrE,CAAC,CAAC,SAAS;YACb,eAAe,EAAE,IAAI,CAAC,eAAe;SACtC,CAAC,CAAC;IACL,CAAC;CACF;AA1HD,wDA0HC","sourcesContent":["import { Connection, Keypair, PublicKey, Transaction } from \"@solana/web3.js\";\nimport { Auth, type AuthCredentials } from \"./auth\";\nimport type { ClientContext } from \"./context\";\nimport {\n signAndSubmitTx as signAndSubmitTxFn,\n signAndSubmitTxConfirmed as signAndSubmitTxConfirmedFn,\n signAndSubmitTxConfirmedWithSlot as signAndSubmitTxConfirmedWithSlotFn,\n signAndSubmitPreparedTxConfirmedWithSlot as signAndSubmitPreparedTxConfirmedWithSlotFn,\n} from \"./context\";\nimport type { ConfirmedTransaction } from \"./context\";\nimport type { FaucetRequest, FaucetResponse } from \"./domain/faucet\";\nimport { Markets } from \"./domain/market\";\nimport { Metrics } from \"./domain/metrics\";\nimport { Notifications } from \"./domain/notification\";\nimport { Orders } from \"./domain/order\";\nimport { Orderbooks } from \"./domain/orderbook\";\nimport { Positions } from \"./domain/position\";\nimport { PriceHistoryClient } from \"./domain/price_history\";\nimport { Referrals } from \"./domain/referral\";\nimport { Trades } from \"./domain/trade\";\nimport { LightconeHttp, RetryPolicy, type CredentialRestorer } from \"./http\";\nimport { LightconeEnv, apiUrl, wsUrl, rpcUrl, programId as envProgramId } from \"./env\";\nimport { Privy } from \"./privy\";\nimport { Rpc } from \"./rpc\";\nimport { RpcFailoverState } from \"./rpcFailover\";\nimport { DepositSource, type OrderbookRules, type PubkeyStr } from \"./shared\";\nimport { type ExternalSigner, type SigningStrategy } from \"./shared/signing\";\nimport { WsClient, type WsConfig } from \"./ws\";\n\nclass AuthState {\n private credentialsValue: AuthCredentials | undefined;\n\n constructor(initial?: AuthCredentials) {\n this.credentialsValue = initial;\n }\n\n getCredentials(): AuthCredentials | undefined {\n return this.credentialsValue;\n }\n\n setCredentials(credentials: AuthCredentials | undefined): void {\n this.credentialsValue = credentials;\n }\n\n async clearCaches(): Promise<void> {\n // No caches to clear — decimals are derived locally from orderbook metadata.\n }\n}\n\nexport class LightconeClient implements ClientContext {\n readonly http: LightconeHttp;\n readonly programId: PublicKey;\n readonly primaryConnection?: Connection;\n readonly backupConnection?: Connection;\n readonly rpcFailoverState: RpcFailoverState;\n private depositSourceValue: DepositSource;\n private signingStrategyValue?: SigningStrategy;\n private transactionSponsorshipEnabledValue: boolean;\n private orderNonceValue: number | undefined;\n private readonly wsConfigValue: WsConfig;\n private readonly authStateStore: AuthState;\n readonly orderbookRulesCache: Map<string, Promise<OrderbookRules>>;\n\n /** @deprecated Use primaryConnection — kept for ClientContext compat. */\n get connection(): Connection | undefined {\n return this.primaryConnection;\n }\n\n constructor(params: {\n http: LightconeHttp;\n wsConfig: WsConfig;\n programId?: PublicKey;\n primaryConnection?: Connection;\n backupConnection?: Connection;\n rpcFailoverState?: RpcFailoverState;\n depositSource?: DepositSource;\n signingStrategy?: SigningStrategy;\n transactionSponsorshipEnabled?: boolean;\n orderNonce?: number;\n authCredentials?: AuthCredentials;\n authState?: AuthState;\n orderbookRulesCache?: Map<string, Promise<OrderbookRules>>;\n }) {\n this.http = params.http;\n this.programId = params.programId ?? envProgramId(LightconeEnv.Prod);\n this.primaryConnection = params.primaryConnection;\n this.backupConnection = params.backupConnection;\n this.rpcFailoverState =\n params.rpcFailoverState ?? new RpcFailoverState();\n this.depositSourceValue = params.depositSource ?? DepositSource.Global;\n this.signingStrategyValue = params.signingStrategy;\n this.transactionSponsorshipEnabledValue =\n params.transactionSponsorshipEnabled ?? false;\n this.orderNonceValue = params.orderNonce;\n this.wsConfigValue = params.wsConfig;\n this.authStateStore =\n params.authState ??\n new AuthState(params.authCredentials);\n this.orderbookRulesCache = params.orderbookRulesCache ?? new Map();\n }\n\n // ── Deposit source ──────────────────────────────────────────────────\n\n get depositSource(): DepositSource {\n return this.depositSourceValue;\n }\n\n setDepositSource(source: DepositSource): void {\n this.depositSourceValue = source;\n }\n\n // ── Signing strategy ────────────────────────────────────────────────\n\n get signingStrategy(): SigningStrategy | undefined {\n return this.signingStrategyValue;\n }\n\n /**\n * Cached authenticated identity shared by domain sub-clients.\n *\n * This is distinct from the HTTP cookie token and may be expired; fund-moving\n * operations must re-check its lifetime and wallet before signing.\n */\n get authCredentials(): AuthCredentials | undefined {\n return this.authStateStore.getCredentials();\n }\n\n setSigningStrategy(strategy: SigningStrategy): void {\n this.signingStrategyValue = strategy;\n }\n\n clearSigningStrategy(): void {\n this.signingStrategyValue = undefined;\n }\n\n /** Return the client-wide trusted assertion that an external sponsor pays fees. */\n get transactionSponsorshipEnabled(): boolean {\n return this.transactionSponsorshipEnabledValue;\n }\n\n /** Replace the Transaction Sponsorship Capability for subsequent submissions. */\n setTransactionSponsorshipEnabled(enabled: boolean): void {\n this.transactionSponsorshipEnabledValue = enabled;\n }\n\n // ── Nonce cache ──────────────────────────────────────────────────────\n\n orderNonce(): number | undefined {\n return this.orderNonceValue;\n }\n\n setOrderNonce(nonce: number): void {\n this.orderNonceValue = nonce;\n }\n\n clearOrderNonce(): void {\n this.orderNonceValue = undefined;\n }\n\n // ── Auth token (cookie) ─────────────────────────────────────────────\n\n /**\n * Get the current `lightcone-token` cookie value, if any. Populated by the SDK\n * after a successful login, then attached on every authed request. Useful\n * for forwarding the token through the `*WithCookies` methods, or\n * persisting the session across processes.\n */\n async authToken(): Promise<string | undefined> {\n return this.http.authTokenRef()();\n }\n\n /**\n * Clear the cached `lightcone-token`. Subsequent authed calls will go out\n * without a `Cookie` header (and 401) unless they use a\n * `*WithCookies` variant.\n */\n async clearAuthToken(): Promise<void> {\n await this.http.clearAuthToken();\n }\n\n /**\n * Register the credential restorer consulted when a request fails with\n * HTTP 401: it attempts to restore credentials (e.g. refresh the app's\n * auth session so the auth cookie is valid again); on success the\n * transport replays the request once IF it declared itself retry-safe\n * (RetryPolicy.None mutations are never auto-replayed). See {@link CredentialRestorer}.\n * Without a restorer, 401s propagate to callers unchanged.\n *\n * Common use: set once at app startup, alongside the signing strategy.\n */\n setCredentialRestorer(restorer: CredentialRestorer): void {\n this.http.setCredentialRestorer(restorer);\n }\n\n /** Remove the credential restorer (e.g. in tests); 401s propagate again. */\n clearCredentialRestorer(): void {\n this.http.clearCredentialRestorer();\n }\n\n // ── Transaction signing + submission ────────────────────────────────\n\n async signAndSubmitTx(tx: Transaction): Promise<string> {\n return signAndSubmitTxFn(this, tx);\n }\n\n /**\n * Sign and submit a transaction, then wait until it reaches `confirmed`\n * commitment on-chain. Prefer this over {@link signAndSubmitTx} when a\n * follow-up transaction depends on this one's state.\n */\n async signAndSubmitTxConfirmed(tx: Transaction): Promise<string> {\n return signAndSubmitTxConfirmedFn(this, tx);\n }\n\n /** Sign, submit, confirm, and return the transaction's processing slot. */\n async signAndSubmitTxConfirmedWithSlot(\n tx: Transaction\n ): Promise<ConfirmedTransaction> {\n return signAndSubmitTxConfirmedWithSlotFn(this, tx);\n }\n\n /**\n * Sign, submit, and confirm a fee-prepared transaction without replacing its\n * message. Privy and wallet-adapter message mutation are rejected. A confirmation\n * timeout leaves the outcome unknown; inspect authoritative state before retrying.\n */\n async signAndSubmitPreparedTxConfirmedWithSlot(\n tx: Transaction\n ): Promise<ConfirmedTransaction> {\n return signAndSubmitPreparedTxConfirmedWithSlotFn(this, tx);\n }\n\n static builder(): LightconeClientBuilder {\n return new LightconeClientBuilder();\n }\n\n // ── Sub-client accessors ─────────────────────────────────────────────\n\n markets(): Markets {\n return new Markets(this);\n }\n\n orderbooks(): Orderbooks {\n return new Orderbooks(this);\n }\n\n orders(): Orders {\n return new Orders(this);\n }\n\n positions(): Positions {\n return new Positions(this);\n }\n\n trades(): Trades {\n return new Trades(this);\n }\n\n priceHistory(): PriceHistoryClient {\n return new PriceHistoryClient(this);\n }\n\n notifications(): Notifications {\n return new Notifications(this);\n }\n\n /**\n * Metrics sub-client — platform / market / orderbook / category / deposit-token\n * volume metrics, market leaderboard, and time-series history.\n */\n metrics(): Metrics {\n return new Metrics(this);\n }\n\n /**\n * Request testnet SOL and whitelisted deposit tokens for a wallet.\n *\n * Only active on environments whose backend has the faucet enabled (typically\n * local and staging).\n *\n * `POST /api/claim`\n */\n async claim(walletAddress: PubkeyStr): Promise<FaucetResponse> {\n const url = `${this.http.baseUrl()}/api/claim`;\n return this.http.post<FaucetResponse, FaucetRequest>(\n url,\n { wallet_address: walletAddress },\n RetryPolicy.None\n );\n }\n\n auth(): Auth {\n return new Auth({\n http: this.http,\n authState: this.authStateStore,\n });\n }\n\n privy(): Privy {\n return new Privy(this);\n }\n\n referrals(): Referrals {\n return new Referrals(this);\n }\n\n rpc(): Rpc {\n return new Rpc(this);\n }\n\n wsConfig(): WsConfig {\n return this.wsConfigValue;\n }\n\n ws(): WsClient {\n return new WsClient(this.wsConfigValue, this.http.authTokenRef());\n }\n\n /**\n * Return a client whose Transaction Sponsorship Capability starts at this value.\n * Later runtime changes remain local to each clone, matching other mutable settings.\n */\n clone(): LightconeClient {\n return new LightconeClient({\n http: this.http,\n wsConfig: { ...this.wsConfigValue },\n programId: this.programId,\n primaryConnection: this.primaryConnection\n ? new Connection(this.primaryConnection.rpcEndpoint, { commitment: \"confirmed\" })\n : undefined,\n backupConnection: this.backupConnection\n ? new Connection(this.backupConnection.rpcEndpoint, { commitment: \"confirmed\" })\n : undefined,\n rpcFailoverState: this.rpcFailoverState,\n depositSource: this.depositSourceValue,\n signingStrategy: this.signingStrategyValue,\n transactionSponsorshipEnabled: this.transactionSponsorshipEnabledValue,\n orderNonce: this.orderNonceValue,\n authState: this.authStateStore,\n orderbookRulesCache: this.orderbookRulesCache,\n });\n }\n}\n\nexport class LightconeClientBuilder {\n private baseUrlValue: string = apiUrl(LightconeEnv.Prod);\n private wsUrlValue: string = wsUrl(LightconeEnv.Prod);\n private authCredentials?: AuthCredentials;\n private programIdValue: PublicKey = envProgramId(LightconeEnv.Prod);\n private depositSourceValue: DepositSource = DepositSource.Global;\n private signingStrategyValue?: SigningStrategy;\n private transactionSponsorshipEnabledValue = false;\n private primaryRpcUrlValue?: string = rpcUrl(LightconeEnv.Prod);\n private backupRpcUrlValue?: string;\n\n /**\n * Set the deployment environment. Configures the API URL, WebSocket URL,\n * RPC URL, and program ID for the given environment.\n *\n * Individual URL overrides (e.g. `.baseUrl()`) take precedence when\n * called **after** `.env()`.\n */\n env(environment: LightconeEnv): LightconeClientBuilder {\n this.baseUrlValue = apiUrl(environment);\n this.wsUrlValue = wsUrl(environment);\n this.programIdValue = envProgramId(environment);\n this.primaryRpcUrlValue = rpcUrl(environment);\n return this;\n }\n\n baseUrl(url: string): LightconeClientBuilder {\n return this.withBaseUrl(url);\n }\n\n withBaseUrl(url: string): LightconeClientBuilder {\n this.baseUrlValue = url;\n return this;\n }\n\n wsUrl(url: string): LightconeClientBuilder {\n return this.withWsUrl(url);\n }\n\n withWsUrl(url: string): LightconeClientBuilder {\n this.wsUrlValue = url;\n return this;\n }\n\n auth(credentials: AuthCredentials): LightconeClientBuilder {\n return this.withAuth(credentials);\n }\n\n withAuth(credentials: AuthCredentials): LightconeClientBuilder {\n this.authCredentials = credentials;\n return this;\n }\n\n programId(id: PublicKey): LightconeClientBuilder {\n this.programIdValue = id;\n return this;\n }\n\n depositSource(source: DepositSource): LightconeClientBuilder {\n this.depositSourceValue = source;\n return this;\n }\n\n nativeSigner(keypair: Keypair): LightconeClientBuilder {\n this.signingStrategyValue = { type: \"native\", keypair };\n return this;\n }\n\n externalSigner(signer: ExternalSigner): LightconeClientBuilder {\n this.signingStrategyValue = { type: \"walletAdapter\", signer };\n return this;\n }\n\n privyWalletId(\n walletId: string,\n walletAddress?: string\n ): LightconeClientBuilder {\n this.signingStrategyValue = { type: \"privy\", walletId, walletAddress };\n return this;\n }\n\n /** Set the initial trusted Transaction Sponsorship Capability; defaults to false. */\n transactionSponsorship(enabled: boolean): LightconeClientBuilder {\n this.transactionSponsorshipEnabledValue = enabled;\n return this;\n }\n\n rpcUrl(url: string): LightconeClientBuilder {\n this.primaryRpcUrlValue = url;\n return this;\n }\n\n /** Set a backup Solana RPC URL for automatic failover. */\n backupRpcUrl(url: string): LightconeClientBuilder {\n this.backupRpcUrlValue = url;\n return this;\n }\n\n build(): LightconeClient {\n return new LightconeClient({\n http: new LightconeHttp(this.baseUrlValue),\n wsConfig: {\n url: this.wsUrlValue,\n reconnect: true,\n maxReconnectAttempts: 10,\n baseReconnectDelayMs: 1_000,\n pingIntervalMs: 30_000,\n pongTimeoutMs: 10_000,\n },\n programId: this.programIdValue,\n depositSource: this.depositSourceValue,\n signingStrategy: this.signingStrategyValue,\n transactionSponsorshipEnabled: this.transactionSponsorshipEnabledValue,\n primaryConnection: this.primaryRpcUrlValue\n ? new Connection(this.primaryRpcUrlValue, { commitment: \"confirmed\" })\n : undefined,\n backupConnection: this.backupRpcUrlValue\n ? new Connection(this.backupRpcUrlValue, { commitment: \"confirmed\" })\n : undefined,\n authCredentials: this.authCredentials,\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AAAA,uDAK+B;AAC/B,6CAAiE;AACjE,iCAAoD;AAEpD,uCAKmB;AAGnB,4CAA0C;AAC1C,8CAA2C;AA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;YAC1C,6BAA6B,EAAE,IAAI,CAAC,kCAAkC;YACtE,iBAAiB,EAAE,IAAI,CAAC,kBAAkB;gBACxC,CAAC,CAAC,IAAI,oBAAU,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC;gBACjG,CAAC,CAAC,SAAS;YACb,gBAAgB,EAAE,IAAI,CAAC,iBAAiB;gBACtC,CAAC,CAAC,IAAI,oBAAU,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC;gBAChG,CAAC,CAAC,SAAS;YACb,oBAAoB,EAAE,IAAI,CAAC,yBAAyB;YACpD,QAAQ,EAAE,IAAI,CAAC,aAAa;YAC5B,eAAe,EAAE,IAAI,CAAC,eAAe;SACtC,CAAC,CAAC;IACL,CAAC;CACF;AA3ID,wDA2IC","sourcesContent":["import {\n V1Transaction,\n validateV1Resources,\n type V1ResourceConfig,\n type V1TransactionContext,\n} from \"./program/transaction\";\nimport { Connection, Keypair, PublicKey } from \"@solana/web3.js\";\nimport { Auth, type AuthCredentials } from \"./auth\";\nimport type { ClientContext } from \"./context\";\nimport {\n signAndSubmitTx as signAndSubmitTxFn,\n signAndSubmitTxConfirmed as signAndSubmitTxConfirmedFn,\n signAndSubmitTxConfirmedWithSlot as signAndSubmitTxConfirmedWithSlotFn,\n signAndSubmitPreparedTxConfirmedWithSlot as signAndSubmitPreparedTxConfirmedWithSlotFn,\n} from \"./context\";\nimport type { ConfirmedTransaction } from \"./context\";\nimport type { FaucetRequest, FaucetResponse } from \"./domain/faucet\";\nimport { Markets } from \"./domain/market\";\nimport { Metrics } from \"./domain/metrics\";\nimport { Notifications } from \"./domain/notification\";\nimport { Orders } from \"./domain/order\";\nimport { Orderbooks } from \"./domain/orderbook\";\nimport { Positions } from \"./domain/position\";\nimport { PriceHistoryClient } from \"./domain/price_history\";\nimport { Referrals } from \"./domain/referral\";\nimport { Trades } from \"./domain/trade\";\nimport { LightconeHttp, RetryPolicy, type CredentialRestorer } from \"./http\";\nimport { LightconeEnv, apiUrl, wsUrl, rpcUrl, programId as envProgramId } from \"./env\";\nimport { Privy } from \"./privy\";\nimport { Rpc } from \"./rpc\";\nimport { RpcFailoverState } from \"./rpcFailover\";\nimport { DepositSource, type OrderbookRules, type PubkeyStr } from \"./shared\";\nimport { type ExternalSigner, type SigningStrategy } from \"./shared/signing\";\nimport { WsClient, type WsConfig } from \"./ws\";\n\nclass AuthState {\n private credentialsValue: AuthCredentials | undefined;\n\n constructor(initial?: AuthCredentials) {\n this.credentialsValue = initial;\n }\n\n getCredentials(): AuthCredentials | undefined {\n return this.credentialsValue;\n }\n\n setCredentials(credentials: AuthCredentials | undefined): void {\n this.credentialsValue = credentials;\n }\n\n async clearCaches(): Promise<void> {\n // No caches to clear — decimals are derived locally from orderbook metadata.\n }\n}\n\nexport class LightconeClient implements ClientContext {\n readonly transactionResources?: V1ResourceConfig;\n readonly rpcFetch?: typeof fetch;\n readonly http: LightconeHttp;\n readonly programId: PublicKey;\n readonly primaryConnection?: Connection;\n readonly backupConnection?: Connection;\n readonly rpcFailoverState: RpcFailoverState;\n private depositSourceValue: DepositSource;\n private signingStrategyValue?: SigningStrategy;\n private transactionSponsorshipEnabledValue: boolean;\n private orderNonceValue: number | undefined;\n private readonly wsConfigValue: WsConfig;\n private readonly authStateStore: AuthState;\n readonly orderbookRulesCache: Map<string, Promise<OrderbookRules>>;\n\n /** @deprecated Use primaryConnection — kept for ClientContext compat. */\n get connection(): Connection | undefined {\n return this.primaryConnection;\n }\n\n constructor(params: {\n http: LightconeHttp;\n wsConfig: WsConfig;\n programId?: PublicKey;\n primaryConnection?: Connection;\n backupConnection?: Connection;\n rpcFailoverState?: RpcFailoverState;\n depositSource?: DepositSource;\n signingStrategy?: SigningStrategy;\n transactionSponsorshipEnabled?: boolean;\n transactionResources?: V1ResourceConfig;\n rpcFetch?: typeof fetch;\n orderNonce?: number;\n authCredentials?: AuthCredentials;\n authState?: AuthState;\n orderbookRulesCache?: Map<string, Promise<OrderbookRules>>;\n }) {\n if (params.transactionResources) validateV1Resources(params.transactionResources);\n this.transactionResources = params.transactionResources\n ? Object.freeze({ ...params.transactionResources })\n : undefined;\n this.rpcFetch = params.rpcFetch;\n this.http = params.http;\n this.programId = params.programId ?? envProgramId(LightconeEnv.Prod);\n this.primaryConnection = params.primaryConnection;\n this.backupConnection = params.backupConnection;\n this.rpcFailoverState =\n params.rpcFailoverState ?? new RpcFailoverState();\n this.depositSourceValue = params.depositSource ?? DepositSource.Global;\n this.signingStrategyValue = params.signingStrategy;\n this.transactionSponsorshipEnabledValue =\n params.transactionSponsorshipEnabled ?? false;\n this.orderNonceValue = params.orderNonce;\n this.wsConfigValue = params.wsConfig;\n this.authStateStore =\n params.authState ??\n new AuthState(params.authCredentials);\n this.orderbookRulesCache = params.orderbookRulesCache ?? new Map();\n }\n\n // ── Deposit source ──────────────────────────────────────────────────\n\n get depositSource(): DepositSource {\n return this.depositSourceValue;\n }\n\n setDepositSource(source: DepositSource): void {\n this.depositSourceValue = source;\n }\n\n // ── Signing strategy ────────────────────────────────────────────────\n\n get signingStrategy(): SigningStrategy | undefined {\n return this.signingStrategyValue;\n }\n\n /**\n * Cached authenticated identity shared by domain sub-clients.\n *\n * This is distinct from the HTTP cookie token and may be expired; fund-moving\n * operations must re-check its lifetime and wallet before signing.\n */\n get authCredentials(): AuthCredentials | undefined {\n return this.authStateStore.getCredentials();\n }\n\n setSigningStrategy(strategy: SigningStrategy): void {\n this.signingStrategyValue = strategy;\n }\n\n clearSigningStrategy(): void {\n this.signingStrategyValue = undefined;\n }\n\n /** Return the client-wide trusted assertion that an external sponsor pays fees. */\n get transactionSponsorshipEnabled(): boolean {\n return this.transactionSponsorshipEnabledValue;\n }\n\n /** Replace the Transaction Sponsorship Capability for subsequent submissions. */\n setTransactionSponsorshipEnabled(enabled: boolean): void {\n this.transactionSponsorshipEnabledValue = enabled;\n }\n\n // ── Nonce cache ──────────────────────────────────────────────────────\n\n orderNonce(): number | undefined {\n return this.orderNonceValue;\n }\n\n setOrderNonce(nonce: number): void {\n this.orderNonceValue = nonce;\n }\n\n clearOrderNonce(): void {\n this.orderNonceValue = undefined;\n }\n\n // ── Auth token (cookie) ─────────────────────────────────────────────\n\n /**\n * Get the current `lightcone-token` cookie value, if any. Populated by the SDK\n * after a successful login, then attached on every authed request. Useful\n * for forwarding the token through the `*WithCookies` methods, or\n * persisting the session across processes.\n */\n async authToken(): Promise<string | undefined> {\n return this.http.authTokenRef()();\n }\n\n /**\n * Clear the cached `lightcone-token`. Subsequent authed calls will go out\n * without a `Cookie` header (and 401) unless they use a\n * `*WithCookies` variant.\n */\n async clearAuthToken(): Promise<void> {\n await this.http.clearAuthToken();\n }\n\n /**\n * Register the credential restorer consulted when a request fails with\n * HTTP 401: it attempts to restore credentials (e.g. refresh the app's\n * auth session so the auth cookie is valid again); on success the\n * transport replays the request once IF it declared itself retry-safe\n * (RetryPolicy.None mutations are never auto-replayed). See {@link CredentialRestorer}.\n * Without a restorer, 401s propagate to callers unchanged.\n *\n * Common use: set once at app startup, alongside the signing strategy.\n */\n setCredentialRestorer(restorer: CredentialRestorer): void {\n this.http.setCredentialRestorer(restorer);\n }\n\n /** Remove the credential restorer (e.g. in tests); 401s propagate again. */\n clearCredentialRestorer(): void {\n this.http.clearCredentialRestorer();\n }\n\n /** Fetch a fresh context with configured v1 transaction resources. */\n transactionContext(): Promise<V1TransactionContext> {\n return this.rpc().transactionContext();\n }\n\n /** Fetch a fresh context with explicit limits and total priority fee lamports. */\n transactionContextWithResources(\n resources: V1ResourceConfig\n ): Promise<V1TransactionContext> {\n return this.rpc().transactionContextWithResources(resources);\n }\n\n // ── Transaction signing + submission ────────────────────────────────\n\n async signAndSubmitTx(tx: V1Transaction): Promise<string> {\n return signAndSubmitTxFn(this, tx);\n }\n\n /**\n * Sign and submit a transaction, then wait until it reaches `confirmed`\n * commitment on-chain. Prefer this over {@link signAndSubmitTx} when a\n * follow-up transaction depends on this one's state.\n */\n async signAndSubmitTxConfirmed(tx: V1Transaction): Promise<string> {\n return signAndSubmitTxConfirmedFn(this, tx);\n }\n\n /** Sign, submit, confirm, and return the transaction's processing slot. */\n async signAndSubmitTxConfirmedWithSlot(\n tx: V1Transaction\n ): Promise<ConfirmedTransaction> {\n return signAndSubmitTxConfirmedWithSlotFn(this, tx);\n }\n\n /**\n * Sign, submit, and confirm a fee-prepared transaction without replacing its\n * message. Privy and wallet-adapter message mutation are rejected. A confirmation\n * timeout leaves the outcome unknown; inspect authoritative state before retrying.\n */\n async signAndSubmitPreparedTxConfirmedWithSlot(\n tx: V1Transaction\n ): Promise<ConfirmedTransaction> {\n return signAndSubmitPreparedTxConfirmedWithSlotFn(this, tx);\n }\n\n static builder(): LightconeClientBuilder {\n return new LightconeClientBuilder();\n }\n\n // ── Sub-client accessors ─────────────────────────────────────────────\n\n markets(): Markets {\n return new Markets(this);\n }\n\n orderbooks(): Orderbooks {\n return new Orderbooks(this);\n }\n\n orders(): Orders {\n return new Orders(this);\n }\n\n positions(): Positions {\n return new Positions(this);\n }\n\n trades(): Trades {\n return new Trades(this);\n }\n\n priceHistory(): PriceHistoryClient {\n return new PriceHistoryClient(this);\n }\n\n notifications(): Notifications {\n return new Notifications(this);\n }\n\n /**\n * Metrics sub-client — platform / market / orderbook / category / deposit-token\n * volume metrics, market leaderboard, and time-series history.\n */\n metrics(): Metrics {\n return new Metrics(this);\n }\n\n /**\n * Request testnet SOL and whitelisted deposit tokens for a wallet.\n *\n * Only active on environments whose backend has the faucet enabled (typically\n * local and staging).\n *\n * `POST /api/claim`\n */\n async claim(walletAddress: PubkeyStr): Promise<FaucetResponse> {\n const url = `${this.http.baseUrl()}/api/claim`;\n return this.http.post<FaucetResponse, FaucetRequest>(\n url,\n { wallet_address: walletAddress },\n RetryPolicy.None\n );\n }\n\n auth(): Auth {\n return new Auth({\n http: this.http,\n authState: this.authStateStore,\n });\n }\n\n privy(): Privy {\n return new Privy(this);\n }\n\n referrals(): Referrals {\n return new Referrals(this);\n }\n\n rpc(): Rpc {\n return new Rpc(this);\n }\n\n wsConfig(): WsConfig {\n return this.wsConfigValue;\n }\n\n ws(): WsClient {\n return new WsClient(this.wsConfigValue, this.http.authTokenRef());\n }\n\n /**\n * Return a client whose Transaction Sponsorship Capability starts at this value.\n * Later runtime changes remain local to each clone, matching other mutable settings.\n */\n clone(): LightconeClient {\n return new LightconeClient({\n http: this.http,\n wsConfig: { ...this.wsConfigValue },\n programId: this.programId,\n primaryConnection: this.primaryConnection\n ? new Connection(this.primaryConnection.rpcEndpoint, { commitment: \"confirmed\", fetch: this.rpcFetch })\n : undefined,\n backupConnection: this.backupConnection\n ? new Connection(this.backupConnection.rpcEndpoint, { commitment: \"confirmed\", fetch: this.rpcFetch })\n : undefined,\n rpcFailoverState: this.rpcFailoverState,\n depositSource: this.depositSourceValue,\n signingStrategy: this.signingStrategyValue,\n transactionSponsorshipEnabled: this.transactionSponsorshipEnabledValue,\n transactionResources: this.transactionResources,\n rpcFetch: this.rpcFetch,\n orderNonce: this.orderNonceValue,\n authState: this.authStateStore,\n orderbookRulesCache: this.orderbookRulesCache,\n });\n }\n}\n\nexport class LightconeClientBuilder {\n private baseUrlValue: string = apiUrl(LightconeEnv.Prod);\n private wsUrlValue: string = wsUrl(LightconeEnv.Prod);\n private authCredentials?: AuthCredentials;\n private programIdValue: PublicKey = envProgramId(LightconeEnv.Prod);\n private depositSourceValue: DepositSource = DepositSource.Global;\n private signingStrategyValue?: SigningStrategy;\n private transactionSponsorshipEnabledValue = false;\n private transactionResourcesValue?: V1ResourceConfig;\n private rpcFetchValue?: typeof fetch;\n private primaryRpcUrlValue?: string = rpcUrl(LightconeEnv.Prod);\n private backupRpcUrlValue?: string;\n\n /**\n * Set the deployment environment. Configures the API URL, WebSocket URL,\n * RPC URL, and program ID for the given environment.\n *\n * Individual URL overrides (e.g. `.baseUrl()`) take precedence when\n * called **after** `.env()`.\n */\n env(environment: LightconeEnv): LightconeClientBuilder {\n this.baseUrlValue = apiUrl(environment);\n this.wsUrlValue = wsUrl(environment);\n this.programIdValue = envProgramId(environment);\n this.primaryRpcUrlValue = rpcUrl(environment);\n return this;\n }\n\n baseUrl(url: string): LightconeClientBuilder {\n return this.withBaseUrl(url);\n }\n\n withBaseUrl(url: string): LightconeClientBuilder {\n this.baseUrlValue = url;\n return this;\n }\n\n wsUrl(url: string): LightconeClientBuilder {\n return this.withWsUrl(url);\n }\n\n withWsUrl(url: string): LightconeClientBuilder {\n this.wsUrlValue = url;\n return this;\n }\n\n auth(credentials: AuthCredentials): LightconeClientBuilder {\n return this.withAuth(credentials);\n }\n\n withAuth(credentials: AuthCredentials): LightconeClientBuilder {\n this.authCredentials = credentials;\n return this;\n }\n\n programId(id: PublicKey): LightconeClientBuilder {\n this.programIdValue = id;\n return this;\n }\n\n depositSource(source: DepositSource): LightconeClientBuilder {\n this.depositSourceValue = source;\n return this;\n }\n\n nativeSigner(keypair: Keypair): LightconeClientBuilder {\n this.signingStrategyValue = { type: \"native\", keypair };\n return this;\n }\n\n externalSigner(signer: ExternalSigner): LightconeClientBuilder {\n this.signingStrategyValue = { type: \"walletAdapter\", signer };\n return this;\n }\n\n privyWalletId(\n walletId: string,\n walletAddress?: string\n ): LightconeClientBuilder {\n this.signingStrategyValue = { type: \"privy\", walletId, walletAddress };\n return this;\n }\n\n /** Set the initial trusted Transaction Sponsorship Capability; defaults to false. */\n transactionSponsorship(enabled: boolean): LightconeClientBuilder {\n this.transactionSponsorshipEnabledValue = enabled;\n return this;\n }\n\n /** Set explicit v1 limits and total priority fee lamports for fluent builders and SOL plans. */\n transactionResources(resources: V1ResourceConfig): LightconeClientBuilder {\n validateV1Resources(resources);\n this.transactionResourcesValue = Object.freeze({ ...resources });\n return this;\n }\n\n /** Set the one-attempt fetch transport for v1 RPC, for example to add RPC authentication headers. */\n rpcFetch(transport: typeof fetch): LightconeClientBuilder {\n this.rpcFetchValue = transport;\n return this;\n }\n\n rpcUrl(url: string): LightconeClientBuilder {\n this.primaryRpcUrlValue = url;\n return this;\n }\n\n /** Set a backup Solana RPC URL for automatic failover. */\n backupRpcUrl(url: string): LightconeClientBuilder {\n this.backupRpcUrlValue = url;\n return this;\n }\n\n build(): LightconeClient {\n return new LightconeClient({\n http: new LightconeHttp(this.baseUrlValue),\n wsConfig: {\n url: this.wsUrlValue,\n reconnect: true,\n maxReconnectAttempts: 10,\n baseReconnectDelayMs: 1_000,\n pingIntervalMs: 30_000,\n pongTimeoutMs: 10_000,\n },\n programId: this.programIdValue,\n depositSource: this.depositSourceValue,\n signingStrategy: this.signingStrategyValue,\n transactionSponsorshipEnabled: this.transactionSponsorshipEnabledValue,\n primaryConnection: this.primaryRpcUrlValue\n ? new Connection(this.primaryRpcUrlValue, { commitment: \"confirmed\", fetch: this.rpcFetchValue })\n : undefined,\n backupConnection: this.backupRpcUrlValue\n ? new Connection(this.backupRpcUrlValue, { commitment: \"confirmed\", fetch: this.rpcFetchValue })\n : undefined,\n transactionResources: this.transactionResourcesValue,\n rpcFetch: this.rpcFetchValue,\n authCredentials: this.authCredentials,\n });\n }\n}\n"]}
|
package/dist/context.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { V1Transaction, type V1ResourceConfig } from "./program/transaction";
|
|
2
|
+
import { type Connection, type PublicKey, type TransactionInstruction } from "@solana/web3.js";
|
|
2
3
|
import type { LightconeHttp } from "./http";
|
|
3
4
|
import type { AuthCredentials } from "./auth";
|
|
4
5
|
import type { DepositSource, OrderbookRules } from "./shared";
|
|
@@ -14,6 +15,9 @@ export interface ClientContext {
|
|
|
14
15
|
readonly signingStrategy?: SigningStrategy;
|
|
15
16
|
/** Trusted application assertion that an external sponsor pays fees; omission is false. */
|
|
16
17
|
readonly transactionSponsorshipEnabled?: boolean;
|
|
18
|
+
readonly transactionResources?: V1ResourceConfig;
|
|
19
|
+
/** Fetch implementation used for canonical v1 JSON-RPC requests, including one-shot sends. */
|
|
20
|
+
readonly rpcFetch?: typeof fetch;
|
|
17
21
|
/** Optional cached identity for auth-bound operations; callers must check expiry. */
|
|
18
22
|
readonly authCredentials?: AuthCredentials;
|
|
19
23
|
orderNonce?(): number | undefined;
|
|
@@ -26,55 +30,21 @@ export declare function requireConnection(ctx: ClientContext): Connection;
|
|
|
26
30
|
export declare function connectionWithFailover<T>(ctx: ClientContext, operation: (conn: Connection) => Promise<T>): Promise<T>;
|
|
27
31
|
export declare function resolveDepositSource(ctx: ClientContext, overrideSource: DepositSource | undefined): DepositSource;
|
|
28
32
|
export declare function requireSigningStrategy(ctx: ClientContext): SigningStrategy;
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
* Fetches a recent blockhash automatically. Returns as soon as the RPC
|
|
33
|
-
* accepts the transaction — inclusion is not awaited. When follow-up work
|
|
34
|
-
* depends on this transaction's on-chain effects, use
|
|
35
|
-
* {@link signAndSubmitTxConfirmed} instead.
|
|
36
|
-
* Unsponsored submission checks exact fee funding before signing when both
|
|
37
|
-
* required RPC observations are available.
|
|
38
|
-
*/
|
|
39
|
-
export declare function signAndSubmitTx(ctx: ClientContext, tx: import("@solana/web3.js").Transaction): Promise<string>;
|
|
40
|
-
/**
|
|
41
|
-
* Sign and submit a transaction, then wait until it reaches `confirmed`
|
|
42
|
-
* commitment on-chain.
|
|
43
|
-
*
|
|
44
|
-
* Sequential flows should prefer this over {@link signAndSubmitTx}: a
|
|
45
|
-
* transaction that depends on a prior transaction's state is only safe to
|
|
46
|
-
* send once that prior transaction has confirmed. See `Rpc.confirmSignature`
|
|
47
|
-
* for the terminal error taxonomy.
|
|
48
|
-
*
|
|
49
|
-
* Expiry (`"TransactionExpired"`) is only ever reported when the submitted
|
|
50
|
-
* transaction provably still carries the blockhash this function fetched:
|
|
51
|
-
* always true for `native`, verified against the signed bytes for
|
|
52
|
-
* `walletAdapter`, and never assumed for `privy` (the backend signs and
|
|
53
|
-
* submits out of the SDK's sight) — those cases end in
|
|
54
|
-
* `"ConfirmationTimeout"` at the poll cap instead.
|
|
55
|
-
*/
|
|
56
|
-
export declare function signAndSubmitTxConfirmed(ctx: ClientContext, tx: import("@solana/web3.js").Transaction): Promise<string>;
|
|
33
|
+
/** @internal Submit builder-owned instructions after local validation, before fetching context. */
|
|
34
|
+
export declare function signAndSubmitInstructions(ctx: ClientContext, instructions: TransactionInstruction[], payer: PublicKey): Promise<string>;
|
|
35
|
+
/** Confirmed signature and the slot required by authoritative balance refresh. */
|
|
57
36
|
export interface ConfirmedTransaction {
|
|
58
37
|
signature: string;
|
|
59
38
|
slot: number;
|
|
60
39
|
}
|
|
61
|
-
/**
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
* the active RPC because a transport failure may occur after acceptance.
|
|
72
|
-
* The unchanged message receives the same best-effort fee-funding preflight as an
|
|
73
|
-
* ordinary transaction before the signer runs. A sponsored external signer may
|
|
74
|
-
* differ from the declared fee payer. The caller-owned transaction is snapshotted
|
|
75
|
-
* before the first await so later caller mutation cannot change fee authority.
|
|
76
|
-
*/
|
|
77
|
-
export declare function signAndSubmitPreparedTxConfirmedWithSlot(ctx: ClientContext, tx: import("@solana/web3.js").Transaction): Promise<ConfirmedTransaction>;
|
|
78
|
-
/** @internal Submit with a strategy already validated for an identity-bound operation. */
|
|
79
|
-
export declare function signAndSubmitTxConfirmedUsingStrategy(ctx: ClientContext, tx: import("@solana/web3.js").Transaction, strategy: SigningStrategy): Promise<string>;
|
|
40
|
+
/** Sign and send one immutable v1 transaction with its original resources and expiry. */
|
|
41
|
+
export declare function signAndSubmitTx(ctx: ClientContext, tx: V1Transaction): Promise<string>;
|
|
42
|
+
/** Sign, submit once, and wait for confirmed commitment using the original expiry. */
|
|
43
|
+
export declare function signAndSubmitTxConfirmed(ctx: ClientContext, tx: V1Transaction): Promise<string>;
|
|
44
|
+
/** Sign and confirm the exact prepared message, returning its processing slot. */
|
|
45
|
+
export declare function signAndSubmitTxConfirmedWithSlot(ctx: ClientContext, tx: V1Transaction): Promise<ConfirmedTransaction>;
|
|
46
|
+
/** Prepared and ordinary v1 messages use the same immutable submission contract. */
|
|
47
|
+
export declare function signAndSubmitPreparedTxConfirmedWithSlot(ctx: ClientContext, tx: V1Transaction): Promise<ConfirmedTransaction>;
|
|
48
|
+
/** @internal Submit with an identity-bound strategy captured before planning. */
|
|
49
|
+
export declare function signAndSubmitTxConfirmedUsingStrategy(ctx: ClientContext, tx: V1Transaction, strategy: SigningStrategy): Promise<string>;
|
|
80
50
|
//# sourceMappingURL=context.d.ts.map
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAE/F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAEL,KAAK,gBAAgB,EAItB,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,SA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