opacity-issuer-core 0.2.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/LICENSE +21 -0
- package/README.md +44 -0
- package/dist/chunk-2STMWRIV.js +164 -0
- package/dist/chunk-2STMWRIV.js.map +1 -0
- package/dist/chunk-3L7NNVUV.cjs +184 -0
- package/dist/chunk-3L7NNVUV.cjs.map +1 -0
- package/dist/chunk-54Q3MU62.js +29 -0
- package/dist/chunk-54Q3MU62.js.map +1 -0
- package/dist/chunk-7ODYBEZH.js +889 -0
- package/dist/chunk-7ODYBEZH.js.map +1 -0
- package/dist/chunk-GMPQFX25.cjs +923 -0
- package/dist/chunk-GMPQFX25.cjs.map +1 -0
- package/dist/chunk-HJQZWNZJ.cjs +33 -0
- package/dist/chunk-HJQZWNZJ.cjs.map +1 -0
- package/dist/documents/index.cjs +170 -0
- package/dist/documents/index.cjs.map +1 -0
- package/dist/documents/index.d.cts +1370 -0
- package/dist/documents/index.d.ts +1370 -0
- package/dist/documents/index.js +5 -0
- package/dist/documents/index.js.map +1 -0
- package/dist/documents/validate.cjs +53 -0
- package/dist/documents/validate.cjs.map +1 -0
- package/dist/documents/validate.d.cts +70 -0
- package/dist/documents/validate.d.ts +70 -0
- package/dist/documents/validate.js +4 -0
- package/dist/documents/validate.js.map +1 -0
- package/dist/index.cjs +8917 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +11088 -0
- package/dist/index.d.ts +11088 -0
- package/dist/index.js +8647 -0
- package/dist/index.js.map +1 -0
- package/dist/subgraph.cjs +891 -0
- package/dist/subgraph.cjs.map +1 -0
- package/dist/subgraph.d.cts +456 -0
- package/dist/subgraph.d.ts +456 -0
- package/dist/subgraph.js +882 -0
- package/dist/subgraph.js.map +1 -0
- package/dist/transport-0_X4HTI6.d.ts +39 -0
- package/dist/transport-uaC5Yl3p.d.cts +39 -0
- package/dist/types-B4Yi7WA4.d.cts +108 -0
- package/dist/types-B4Yi7WA4.d.ts +108 -0
- package/package.json +75 -0
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
import { Hex, Address } from 'viem';
|
|
2
|
+
import { O as OpacityIssuerError, F as FetchLike } from './transport-0_X4HTI6.js';
|
|
3
|
+
import './types-B4Yi7WA4.js';
|
|
4
|
+
|
|
5
|
+
type IndexerErrorCode = 'NOT_CONFIGURED' | 'INVALID_ARGUMENT' | 'ABORTED' | 'TIMEOUT' | 'TRANSPORT' | 'HTTP' | 'GRAPHQL' | 'INDEXING_ERROR' | 'INVALID_RESPONSE' | 'DEPLOYMENT_CHANGED' | 'SNAPSHOT_CHANGED';
|
|
6
|
+
/** Indexer failures never represent a failed on-chain transaction. */
|
|
7
|
+
declare class OpacityIndexerError extends OpacityIssuerError {
|
|
8
|
+
readonly code: IndexerErrorCode;
|
|
9
|
+
constructor(code: IndexerErrorCode, message: string, options?: {
|
|
10
|
+
cause?: unknown;
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface Field<T> {
|
|
15
|
+
selection?: string;
|
|
16
|
+
parse(value: unknown, path: string, domain?: boolean): T;
|
|
17
|
+
}
|
|
18
|
+
type Parsed<T> = T extends Field<infer V> ? V : never;
|
|
19
|
+
declare const userRef: Field<{
|
|
20
|
+
id: `0x${string}`;
|
|
21
|
+
}>;
|
|
22
|
+
declare const metaField: Field<{
|
|
23
|
+
deployment: string;
|
|
24
|
+
hasIndexingErrors: boolean;
|
|
25
|
+
block: {
|
|
26
|
+
number: bigint;
|
|
27
|
+
hash: `0x${string}` | null;
|
|
28
|
+
timestamp: bigint | null;
|
|
29
|
+
};
|
|
30
|
+
}>;
|
|
31
|
+
declare const tokenField: Field<{
|
|
32
|
+
id: `0x${string}`;
|
|
33
|
+
issuer: {
|
|
34
|
+
id: `0x${string}`;
|
|
35
|
+
};
|
|
36
|
+
issuerAdmin: `0x${string}` | null;
|
|
37
|
+
allowlistRegistry: `0x${string}`;
|
|
38
|
+
name: string | null;
|
|
39
|
+
symbol: string | null;
|
|
40
|
+
paused: boolean;
|
|
41
|
+
mintingPaused: boolean;
|
|
42
|
+
policyEngine: `0x${string}` | null;
|
|
43
|
+
transferOperator: `0x${string}` | null;
|
|
44
|
+
tokenTraitRegistry: `0x${string}` | null;
|
|
45
|
+
maxPolicies: bigint | null;
|
|
46
|
+
activePolicyCount: bigint;
|
|
47
|
+
activeRuleSetSnapshot: `0x${string}` | null;
|
|
48
|
+
ruleSetDeploymentCount: bigint;
|
|
49
|
+
deployedAtBlock: bigint;
|
|
50
|
+
deployedAtTimestamp: bigint;
|
|
51
|
+
deployTxHash: `0x${string}`;
|
|
52
|
+
beaconVariant: {
|
|
53
|
+
id: `0x${string}`;
|
|
54
|
+
beacon: `0x${string}`;
|
|
55
|
+
isActive: boolean;
|
|
56
|
+
} | null;
|
|
57
|
+
}>;
|
|
58
|
+
declare const supplyField: Field<{
|
|
59
|
+
id: `0x${string}`;
|
|
60
|
+
token: {
|
|
61
|
+
id: `0x${string}`;
|
|
62
|
+
};
|
|
63
|
+
tokenId: bigint;
|
|
64
|
+
totalSupply: bigint;
|
|
65
|
+
maxSupply: bigint;
|
|
66
|
+
holderCount: bigint;
|
|
67
|
+
}>;
|
|
68
|
+
declare const policyField: Field<{
|
|
69
|
+
id: `0x${string}`;
|
|
70
|
+
token: {
|
|
71
|
+
id: `0x${string}`;
|
|
72
|
+
};
|
|
73
|
+
implementation: {
|
|
74
|
+
id: `0x${string}`;
|
|
75
|
+
status: "UNKNOWN" | "PENDING" | "APPROVED" | "REVOKED" | "CANCELLED";
|
|
76
|
+
};
|
|
77
|
+
policyType: "TRADING_DISABLED_V1" | "ALLOWED_TRANSFEREE_V1" | "HOLDER_COUNT_CAP_V1" | "CEILING_BALANCE_V1" | "FLOOR_BALANCE_V1" | "DENYLIST_V1" | "INSIDER_FREEZE_V1" | "SELF_TRANSFER_ONLY_V1" | "UNKNOWN";
|
|
78
|
+
scopeKey: `0x${string}`;
|
|
79
|
+
active: boolean;
|
|
80
|
+
rawConfig: `0x${string}`;
|
|
81
|
+
guardTrait: `0x${string}`;
|
|
82
|
+
guardMode: "NONE" | "ONLY_IF_FROM_HAS" | "ONLY_IF_TO_HAS" | "ONLY_IF_EITHER_HAS";
|
|
83
|
+
guardTraitIsGlobal: boolean;
|
|
84
|
+
configEnabled: boolean | null;
|
|
85
|
+
configMaxHolders: bigint | null;
|
|
86
|
+
configIsPercentage: boolean | null;
|
|
87
|
+
configCeiling: bigint | null;
|
|
88
|
+
configDenominatorMode: "CURRENT_SUPPLY" | "MAX_SUPPLY" | null;
|
|
89
|
+
configTraitList: `0x${string}`[] | null;
|
|
90
|
+
configRequireAll: boolean | null;
|
|
91
|
+
attachedAtBlock: bigint;
|
|
92
|
+
lastReconfiguredAtBlock: bigint | null;
|
|
93
|
+
}>;
|
|
94
|
+
declare const entryField: Field<{
|
|
95
|
+
id: `0x${string}`;
|
|
96
|
+
status: "VERIFIED" | "COMPLIANCE_REMOVAL" | "USER_REMOVAL" | "MIGRATED";
|
|
97
|
+
user: {
|
|
98
|
+
id: `0x${string}`;
|
|
99
|
+
} | null;
|
|
100
|
+
expiresAt: bigint | null;
|
|
101
|
+
addedBy: `0x${string}` | null;
|
|
102
|
+
migratedTo: `0x${string}` | null;
|
|
103
|
+
migratedFrom: `0x${string}` | null;
|
|
104
|
+
lastUpdatedBlock: bigint;
|
|
105
|
+
lastUpdatedTimestamp: bigint;
|
|
106
|
+
}>;
|
|
107
|
+
declare const accountField: Field<{
|
|
108
|
+
id: `0x${string}`;
|
|
109
|
+
isAuthorizedIssuer: boolean;
|
|
110
|
+
allowlistEntry: {
|
|
111
|
+
id: `0x${string}`;
|
|
112
|
+
status: "VERIFIED" | "COMPLIANCE_REMOVAL" | "USER_REMOVAL" | "MIGRATED";
|
|
113
|
+
user: {
|
|
114
|
+
id: `0x${string}`;
|
|
115
|
+
} | null;
|
|
116
|
+
expiresAt: bigint | null;
|
|
117
|
+
addedBy: `0x${string}` | null;
|
|
118
|
+
migratedTo: `0x${string}` | null;
|
|
119
|
+
migratedFrom: `0x${string}` | null;
|
|
120
|
+
lastUpdatedBlock: bigint;
|
|
121
|
+
lastUpdatedTimestamp: bigint;
|
|
122
|
+
} | null;
|
|
123
|
+
}>;
|
|
124
|
+
declare const globalTraitField: Field<{
|
|
125
|
+
id: `0x${string}`;
|
|
126
|
+
user: {
|
|
127
|
+
id: `0x${string}`;
|
|
128
|
+
};
|
|
129
|
+
traitId: `0x${string}`;
|
|
130
|
+
enabled: boolean;
|
|
131
|
+
lastUpdatedBy: `0x${string}`;
|
|
132
|
+
lastUpdatedBlock: bigint;
|
|
133
|
+
lastUpdatedTimestamp: bigint;
|
|
134
|
+
traitConfig: {
|
|
135
|
+
expiryDuration: bigint;
|
|
136
|
+
teeEnableable: boolean;
|
|
137
|
+
writerEnableable: boolean;
|
|
138
|
+
};
|
|
139
|
+
}>;
|
|
140
|
+
declare const tokenTraitField: Field<{
|
|
141
|
+
id: `0x${string}`;
|
|
142
|
+
token: {
|
|
143
|
+
id: `0x${string}`;
|
|
144
|
+
};
|
|
145
|
+
user: {
|
|
146
|
+
id: `0x${string}`;
|
|
147
|
+
};
|
|
148
|
+
traitId: `0x${string}`;
|
|
149
|
+
enabled: boolean;
|
|
150
|
+
lastUpdatedBlock: bigint;
|
|
151
|
+
lastUpdatedTimestamp: bigint;
|
|
152
|
+
}>;
|
|
153
|
+
declare const walletBalanceField: Field<{
|
|
154
|
+
id: `0x${string}`;
|
|
155
|
+
token: {
|
|
156
|
+
id: `0x${string}`;
|
|
157
|
+
};
|
|
158
|
+
account: {
|
|
159
|
+
id: `0x${string}`;
|
|
160
|
+
};
|
|
161
|
+
tokenId: bigint;
|
|
162
|
+
balance: bigint;
|
|
163
|
+
frozenAmount: bigint;
|
|
164
|
+
}>;
|
|
165
|
+
declare const userBalanceField: Field<{
|
|
166
|
+
id: `0x${string}`;
|
|
167
|
+
token: {
|
|
168
|
+
id: `0x${string}`;
|
|
169
|
+
};
|
|
170
|
+
user: {
|
|
171
|
+
id: `0x${string}`;
|
|
172
|
+
};
|
|
173
|
+
tokenId: bigint;
|
|
174
|
+
balance: bigint;
|
|
175
|
+
openIntervalId: `0x${string}` | null;
|
|
176
|
+
}>;
|
|
177
|
+
declare const transferField: Field<{
|
|
178
|
+
id: `0x${string}`;
|
|
179
|
+
token: {
|
|
180
|
+
id: `0x${string}`;
|
|
181
|
+
};
|
|
182
|
+
operator: `0x${string}`;
|
|
183
|
+
from: {
|
|
184
|
+
id: `0x${string}`;
|
|
185
|
+
};
|
|
186
|
+
to: {
|
|
187
|
+
id: `0x${string}`;
|
|
188
|
+
};
|
|
189
|
+
tokenId: bigint;
|
|
190
|
+
value: bigint;
|
|
191
|
+
isBatch: boolean;
|
|
192
|
+
batchIndex: bigint;
|
|
193
|
+
blockNumber: bigint;
|
|
194
|
+
blockTimestamp: bigint;
|
|
195
|
+
transactionHash: `0x${string}`;
|
|
196
|
+
logIndex: bigint;
|
|
197
|
+
}>;
|
|
198
|
+
declare const attestationField: Field<{
|
|
199
|
+
id: `0x${string}`;
|
|
200
|
+
attestor: {
|
|
201
|
+
id: `0x${string}`;
|
|
202
|
+
};
|
|
203
|
+
document: {
|
|
204
|
+
id: `0x${string}`;
|
|
205
|
+
};
|
|
206
|
+
user: {
|
|
207
|
+
id: `0x${string}`;
|
|
208
|
+
};
|
|
209
|
+
wallet: `0x${string}`;
|
|
210
|
+
traitId: `0x${string}`;
|
|
211
|
+
docHash: `0x${string}`;
|
|
212
|
+
nonce: `0x${string}`;
|
|
213
|
+
globalTrait: {
|
|
214
|
+
id: `0x${string}`;
|
|
215
|
+
enabled: boolean;
|
|
216
|
+
};
|
|
217
|
+
blockNumber: bigint;
|
|
218
|
+
blockTimestamp: bigint;
|
|
219
|
+
transactionHash: `0x${string}`;
|
|
220
|
+
logIndex: bigint;
|
|
221
|
+
}>;
|
|
222
|
+
declare const registryField: Field<{
|
|
223
|
+
id: string;
|
|
224
|
+
contractAddress: `0x${string}`;
|
|
225
|
+
paused: boolean;
|
|
226
|
+
defaultExpiryDuration: bigint | null;
|
|
227
|
+
authorizedSigner: `0x${string}` | null;
|
|
228
|
+
teeTraitAllowlistEnforced: boolean;
|
|
229
|
+
}>;
|
|
230
|
+
declare const uriField: Field<{
|
|
231
|
+
id: `0x${string}`;
|
|
232
|
+
token: {
|
|
233
|
+
id: `0x${string}`;
|
|
234
|
+
};
|
|
235
|
+
tokenId: bigint;
|
|
236
|
+
uri: string;
|
|
237
|
+
lastUpdatedBlock: bigint;
|
|
238
|
+
}>;
|
|
239
|
+
declare const vaultField: Field<{
|
|
240
|
+
id: `0x${string}`;
|
|
241
|
+
token: {
|
|
242
|
+
id: `0x${string}`;
|
|
243
|
+
};
|
|
244
|
+
tokenId: bigint;
|
|
245
|
+
stablecoin: `0x${string}`;
|
|
246
|
+
firstObservedAtBlock: bigint;
|
|
247
|
+
firstObservedAtTimestamp: bigint;
|
|
248
|
+
firstObservedTxHash: `0x${string}`;
|
|
249
|
+
depositCount: bigint;
|
|
250
|
+
withdrawalCount: bigint;
|
|
251
|
+
totalDeposited: bigint;
|
|
252
|
+
totalWithdrawn: bigint;
|
|
253
|
+
adminExecutionCount: bigint;
|
|
254
|
+
}>;
|
|
255
|
+
declare const vaultMovementField: Field<{
|
|
256
|
+
user: {
|
|
257
|
+
id: `0x${string}`;
|
|
258
|
+
};
|
|
259
|
+
amount: bigint;
|
|
260
|
+
id: `0x${string}`;
|
|
261
|
+
vault: {
|
|
262
|
+
id: `0x${string}`;
|
|
263
|
+
};
|
|
264
|
+
token: {
|
|
265
|
+
id: `0x${string}`;
|
|
266
|
+
};
|
|
267
|
+
blockNumber: bigint;
|
|
268
|
+
blockTimestamp: bigint;
|
|
269
|
+
transactionHash: `0x${string}`;
|
|
270
|
+
}>;
|
|
271
|
+
declare const vaultAdminField: Field<{
|
|
272
|
+
owner: `0x${string}`;
|
|
273
|
+
target: `0x${string}`;
|
|
274
|
+
selector: `0x${string}`;
|
|
275
|
+
id: `0x${string}`;
|
|
276
|
+
vault: {
|
|
277
|
+
id: `0x${string}`;
|
|
278
|
+
};
|
|
279
|
+
token: {
|
|
280
|
+
id: `0x${string}`;
|
|
281
|
+
};
|
|
282
|
+
blockNumber: bigint;
|
|
283
|
+
blockTimestamp: bigint;
|
|
284
|
+
transactionHash: `0x${string}`;
|
|
285
|
+
}>;
|
|
286
|
+
type IndexerMetadata = Parsed<typeof metaField>;
|
|
287
|
+
type IndexedToken = Parsed<typeof tokenField>;
|
|
288
|
+
type IndexedTokenId = Parsed<typeof supplyField>;
|
|
289
|
+
type IndexedPolicy = Parsed<typeof policyField>;
|
|
290
|
+
type IndexedAccount = Parsed<typeof accountField>;
|
|
291
|
+
type IndexedUser = Parsed<typeof userRef>;
|
|
292
|
+
type IndexedAllowlistEntry = Parsed<typeof entryField>;
|
|
293
|
+
type IndexedGlobalTrait = Parsed<typeof globalTraitField>;
|
|
294
|
+
type IndexedTokenTrait = Parsed<typeof tokenTraitField>;
|
|
295
|
+
type IndexedWalletBalance = Parsed<typeof walletBalanceField>;
|
|
296
|
+
type IndexedUserBalance = Parsed<typeof userBalanceField>;
|
|
297
|
+
type IndexedBalance = IndexedWalletBalance | IndexedUserBalance;
|
|
298
|
+
type IndexedTransfer = Parsed<typeof transferField>;
|
|
299
|
+
type IndexedDocumentAttestation = Parsed<typeof attestationField>;
|
|
300
|
+
type IndexedRegistry = Parsed<typeof registryField>;
|
|
301
|
+
type IndexedTokenURI = Parsed<typeof uriField>;
|
|
302
|
+
/** Event totals are historical activity, not current reserves or redemption liquidity. */
|
|
303
|
+
type IndexedVault = Parsed<typeof vaultField>;
|
|
304
|
+
type IndexedVaultMovement = Parsed<typeof vaultMovementField>;
|
|
305
|
+
type IndexedVaultAdminExecution = Parsed<typeof vaultAdminField>;
|
|
306
|
+
interface IndexerRequestOptions {
|
|
307
|
+
signal?: AbortSignal;
|
|
308
|
+
timeoutMs?: number;
|
|
309
|
+
/** Indexed historical state; Graph Node may prune old blocks. Omit to read its current head. */
|
|
310
|
+
blockNumber?: bigint;
|
|
311
|
+
/** Prefer a block hash from getMetadata() to keep a snapshot stable across chain reorgs. */
|
|
312
|
+
blockHash?: Hex;
|
|
313
|
+
}
|
|
314
|
+
/** Opaque to consumers: reuse unchanged with the same method and filters. */
|
|
315
|
+
interface IndexerCursor {
|
|
316
|
+
after: Hex;
|
|
317
|
+
blockNumber: bigint;
|
|
318
|
+
/** Null when Graph Node did not expose the historical block hash. */
|
|
319
|
+
blockHash: Hex | null;
|
|
320
|
+
deployment: string;
|
|
321
|
+
scope: string;
|
|
322
|
+
}
|
|
323
|
+
interface IndexerPageOptions extends IndexerRequestOptions {
|
|
324
|
+
/** Default 100; integer 1–999. A further row is fetched to detect continuation. */
|
|
325
|
+
pageSize?: number;
|
|
326
|
+
cursor?: IndexerCursor;
|
|
327
|
+
}
|
|
328
|
+
interface IndexedResult<T> {
|
|
329
|
+
item: T | null;
|
|
330
|
+
meta: IndexerMetadata;
|
|
331
|
+
}
|
|
332
|
+
interface IndexedPage<T> {
|
|
333
|
+
items: T[];
|
|
334
|
+
meta: IndexerMetadata;
|
|
335
|
+
nextCursor: IndexerCursor | null;
|
|
336
|
+
}
|
|
337
|
+
interface ListIndexedTokensParams extends IndexerPageOptions {
|
|
338
|
+
issuer?: Address;
|
|
339
|
+
registry?: Address;
|
|
340
|
+
}
|
|
341
|
+
interface TokenIndexPageParams extends IndexerPageOptions {
|
|
342
|
+
token: Address;
|
|
343
|
+
}
|
|
344
|
+
interface ListIndexedPoliciesParams extends TokenIndexPageParams {
|
|
345
|
+
/** Defaults to true. Pass false for detached policies. */
|
|
346
|
+
active?: boolean;
|
|
347
|
+
}
|
|
348
|
+
interface UserIndexPageParams extends IndexerPageOptions {
|
|
349
|
+
userId: Hex;
|
|
350
|
+
}
|
|
351
|
+
interface ListIndexedTokenTraitsParams extends UserIndexPageParams {
|
|
352
|
+
token?: Address;
|
|
353
|
+
}
|
|
354
|
+
interface ListIndexedBalancesParams extends IndexerPageOptions {
|
|
355
|
+
/** Mutually exclusive with userId. Without either filter, lists wallet balances. */
|
|
356
|
+
wallet?: Address;
|
|
357
|
+
userId?: Hex;
|
|
358
|
+
token?: Address;
|
|
359
|
+
tokenId?: bigint;
|
|
360
|
+
/** Defaults to true; false also includes zero balances. */
|
|
361
|
+
positiveOnly?: boolean;
|
|
362
|
+
}
|
|
363
|
+
interface ListIndexedTransfersParams extends IndexerPageOptions {
|
|
364
|
+
wallet?: Address;
|
|
365
|
+
token?: Address;
|
|
366
|
+
tokenId?: bigint;
|
|
367
|
+
}
|
|
368
|
+
interface ListIndexedDocumentAttestationsParams extends IndexerPageOptions {
|
|
369
|
+
wallet?: Address;
|
|
370
|
+
userId?: Hex;
|
|
371
|
+
traitId?: Hex;
|
|
372
|
+
}
|
|
373
|
+
interface ListIndexedVaultsParams extends IndexerPageOptions {
|
|
374
|
+
token?: Address;
|
|
375
|
+
}
|
|
376
|
+
interface ListIndexedVaultMovementsParams extends ListIndexedVaultsParams {
|
|
377
|
+
vault?: Address;
|
|
378
|
+
wallet?: Address;
|
|
379
|
+
}
|
|
380
|
+
interface ListIndexedVaultAdminExecutionsParams extends ListIndexedVaultsParams {
|
|
381
|
+
vault?: Address;
|
|
382
|
+
owner?: Address;
|
|
383
|
+
target?: Address;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Event-indexed views, not transaction preflight or live balances. The endpoint defines the
|
|
387
|
+
* indexed chain/registry; Graph metadata identifies a deployment, not a chain id. Verify that
|
|
388
|
+
* deployment and token.allowlistRegistry against your intended contract environment.
|
|
389
|
+
*
|
|
390
|
+
* Arrays are separate paged queries so traits, token IDs and histories cannot truncate silently.
|
|
391
|
+
* getUser supplies the identity row; use listUserAccounts/listGlobalTraits/listTokenTraits to
|
|
392
|
+
* traverse it. A historical attestation does not establish a currently enabled trait.
|
|
393
|
+
*/
|
|
394
|
+
interface OpacityIndexerNamespace {
|
|
395
|
+
getMetadata(options?: IndexerRequestOptions): Promise<IndexerMetadata>;
|
|
396
|
+
getRegistry(options?: IndexerRequestOptions): Promise<IndexedResult<IndexedRegistry>>;
|
|
397
|
+
listTokens(params?: ListIndexedTokensParams): Promise<IndexedPage<IndexedToken>>;
|
|
398
|
+
getToken(token: Address, options?: IndexerRequestOptions): Promise<IndexedResult<IndexedToken>>;
|
|
399
|
+
listTokenIds(params: TokenIndexPageParams): Promise<IndexedPage<IndexedTokenId>>;
|
|
400
|
+
listTokenURIs(params: TokenIndexPageParams): Promise<IndexedPage<IndexedTokenURI>>;
|
|
401
|
+
listPolicies(params: ListIndexedPoliciesParams): Promise<IndexedPage<IndexedPolicy>>;
|
|
402
|
+
getAccount(wallet: Address, options?: IndexerRequestOptions): Promise<IndexedResult<IndexedAccount>>;
|
|
403
|
+
getUser(userId: Hex, options?: IndexerRequestOptions): Promise<IndexedResult<IndexedUser>>;
|
|
404
|
+
listUserAccounts(params: UserIndexPageParams): Promise<IndexedPage<IndexedAllowlistEntry>>;
|
|
405
|
+
listGlobalTraits(params: UserIndexPageParams): Promise<IndexedPage<IndexedGlobalTrait>>;
|
|
406
|
+
listTokenTraits(params: ListIndexedTokenTraitsParams): Promise<IndexedPage<IndexedTokenTrait>>;
|
|
407
|
+
listBalances(params?: ListIndexedBalancesParams): Promise<IndexedPage<IndexedBalance>>;
|
|
408
|
+
listTransfers(params?: ListIndexedTransfersParams): Promise<IndexedPage<IndexedTransfer>>;
|
|
409
|
+
listDocumentAttestations(params?: ListIndexedDocumentAttestationsParams): Promise<IndexedPage<IndexedDocumentAttestation>>;
|
|
410
|
+
/** Requires the sandbox v3 subgraph schema; includes previously assigned vaults. */
|
|
411
|
+
getVault(vault: Address, options?: IndexerRequestOptions): Promise<IndexedResult<IndexedVault>>;
|
|
412
|
+
listVaults(params?: ListIndexedVaultsParams): Promise<IndexedPage<IndexedVault>>;
|
|
413
|
+
listVaultDeposits(params?: ListIndexedVaultMovementsParams): Promise<IndexedPage<IndexedVaultMovement>>;
|
|
414
|
+
listVaultWithdrawals(params?: ListIndexedVaultMovementsParams): Promise<IndexedPage<IndexedVaultMovement>>;
|
|
415
|
+
listVaultAdminExecutions(params?: ListIndexedVaultAdminExecutionsParams): Promise<IndexedPage<IndexedVaultAdminExecution>>;
|
|
416
|
+
}
|
|
417
|
+
/** Separate unauthenticated transport: mobile-api headers and wallet auth never enter this factory. */
|
|
418
|
+
declare function createIndexerNamespace(config: {
|
|
419
|
+
url?: string | undefined;
|
|
420
|
+
fetch?: FetchLike;
|
|
421
|
+
timeoutMs?: number;
|
|
422
|
+
}): OpacityIndexerNamespace;
|
|
423
|
+
/** Validate API-decoded domain values with the same schemas used for direct GraphQL data. */
|
|
424
|
+
declare function validateIndexerOperationResult(operation: keyof OpacityIndexerNamespace, value: unknown, args?: readonly unknown[]): unknown;
|
|
425
|
+
|
|
426
|
+
type IndexerOperation = keyof OpacityIndexerNamespace;
|
|
427
|
+
/** Named operations only; hosted requests never carry arbitrary GraphQL or upstream URLs. */
|
|
428
|
+
declare const INDEXER_OPERATIONS: readonly IndexerOperation[];
|
|
429
|
+
/** Validate decoded arguments for both direct clients and API adapters without changing defaults. */
|
|
430
|
+
declare function validateIndexerOperationArgs(operation: IndexerOperation, args: unknown): unknown[];
|
|
431
|
+
|
|
432
|
+
type WireValue = null | boolean | number | string | WireValue[] | {
|
|
433
|
+
[key: string]: WireValue;
|
|
434
|
+
};
|
|
435
|
+
/** Lossless JSON encoding. The reserved __bigint marker must contain only a decimal integer. */
|
|
436
|
+
declare function encodeWireValue(value: unknown): WireValue;
|
|
437
|
+
/** Decode only the reserved marker; ordinary decimal strings remain strings. */
|
|
438
|
+
declare function decodeWireValue(value: unknown): unknown;
|
|
439
|
+
|
|
440
|
+
interface SubgraphRequestOptions {
|
|
441
|
+
signal?: AbortSignal;
|
|
442
|
+
timeoutMs?: number;
|
|
443
|
+
}
|
|
444
|
+
interface SubgraphClientConfig {
|
|
445
|
+
url: string;
|
|
446
|
+
fetch?: FetchLike;
|
|
447
|
+
timeoutMs?: number;
|
|
448
|
+
headers?: Record<string, string>;
|
|
449
|
+
}
|
|
450
|
+
interface SubgraphClient {
|
|
451
|
+
query<T>(query: string, variables?: Record<string, unknown>, options?: SubgraphRequestOptions): Promise<T>;
|
|
452
|
+
}
|
|
453
|
+
/** Direct GraphQL adapter for trusted applications that own their endpoint configuration. */
|
|
454
|
+
declare function createSubgraphClient(config: SubgraphClientConfig): SubgraphClient;
|
|
455
|
+
|
|
456
|
+
export { INDEXER_OPERATIONS, type IndexedAccount, type IndexedAllowlistEntry, type IndexedBalance, type IndexedDocumentAttestation, type IndexedGlobalTrait, type IndexedPage, type IndexedPolicy, type IndexedRegistry, type IndexedResult, type IndexedToken, type IndexedTokenId, type IndexedTokenTrait, type IndexedTokenURI, type IndexedTransfer, type IndexedUser, type IndexedUserBalance, type IndexedVault, type IndexedVaultAdminExecution, type IndexedVaultMovement, type IndexedWalletBalance, type IndexerCursor, type IndexerErrorCode, type IndexerMetadata, type IndexerOperation, type IndexerPageOptions, type IndexerRequestOptions, type ListIndexedBalancesParams, type ListIndexedDocumentAttestationsParams, type ListIndexedPoliciesParams, type ListIndexedTokenTraitsParams, type ListIndexedTokensParams, type ListIndexedTransfersParams, type ListIndexedVaultAdminExecutionsParams, type ListIndexedVaultMovementsParams, type ListIndexedVaultsParams, OpacityIndexerError, type OpacityIndexerNamespace, type SubgraphClient, type SubgraphClientConfig, type SubgraphRequestOptions, type TokenIndexPageParams, type UserIndexPageParams, type WireValue, createIndexerNamespace, createSubgraphClient, decodeWireValue, encodeWireValue, validateIndexerOperationArgs, validateIndexerOperationResult };
|