datai-sdk 1.0.6 → 1.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.
Files changed (36) hide show
  1. package/API/v1/activePositions/ActivePositionsResult.ts +221 -3
  2. package/API/v1/activePositions/NftItem.ts +63 -0
  3. package/API/v1/activePositions/PerpPosition.ts +129 -0
  4. package/API/v1/activePositions/TokenBalance.ts +32 -1
  5. package/API/v1/activePositions/activePositions.ts +8 -1
  6. package/API/v1/index.ts +6 -0
  7. package/API/v1/proto/activePositions/activePositions/ActivePositionsResultPb.ts +159 -0
  8. package/API/v1/proto/activePositions/activePositions/NftItemPb.ts +71 -0
  9. package/API/v1/proto/activePositions/activePositions/PerpPositionPb.ts +142 -0
  10. package/API/v1/proto/activePositions/activePositions/PerpSide.ts +10 -0
  11. package/API/v1/proto/activePositions/activePositions/TokenBalancePb.ts +71 -0
  12. package/API/v1/proto/activePositions/google/protobuf/Timestamp.ts +48 -0
  13. package/API/v1/proto/watcher/WatcherInputPb.ts +121 -0
  14. package/API/v1/watcher/WatcherInput.ts +100 -2
  15. package/API/v1/watcher/watcher.ts +154 -4
  16. package/package.json +5 -2
  17. package/postinstall-script.js +4 -2
  18. package/@graphprotocol/graph-ts/README.md +0 -13
  19. package/@graphprotocol/graph-ts/chain/arweave.ts +0 -82
  20. package/@graphprotocol/graph-ts/chain/cosmos.ts +0 -426
  21. package/@graphprotocol/graph-ts/chain/ethereum.ts +0 -727
  22. package/@graphprotocol/graph-ts/chain/near.ts +0 -420
  23. package/@graphprotocol/graph-ts/chain/starknet.ts +0 -39
  24. package/@graphprotocol/graph-ts/common/collections.ts +0 -495
  25. package/@graphprotocol/graph-ts/common/conversion.ts +0 -3
  26. package/@graphprotocol/graph-ts/common/datasource.ts +0 -41
  27. package/@graphprotocol/graph-ts/common/eager_offset.ts +0 -42
  28. package/@graphprotocol/graph-ts/common/json.ts +0 -28
  29. package/@graphprotocol/graph-ts/common/numbers.ts +0 -407
  30. package/@graphprotocol/graph-ts/common/value.ts +0 -585
  31. package/@graphprotocol/graph-ts/global/global.ts +0 -4
  32. package/@graphprotocol/graph-ts/helper-functions.ts +0 -79
  33. package/@graphprotocol/graph-ts/index.ts +0 -156
  34. package/@graphprotocol/graph-ts/package.json +0 -3
  35. package/@graphprotocol/graph-ts/tsconfig.json +0 -4
  36. package/@graphprotocol/graph-ts/types/tsconfig.base.json +0 -3
@@ -1,426 +0,0 @@
1
- import '../common/eager_offset';
2
- import { Bytes } from '../common/collections';
3
-
4
- export namespace cosmos {
5
- export class Block {
6
- constructor(
7
- public header: Header,
8
- public evidence: EvidenceList,
9
- public lastCommit: Commit,
10
- public resultBeginBlock: ResponseBeginBlock,
11
- public resultEndBlock: ResponseEndBlock,
12
- public transactions: Array<TxResult>,
13
- public validatorUpdates: Array<Validator>,
14
- ) {}
15
- }
16
-
17
- export class HeaderOnlyBlock {
18
- constructor(public header: Header) {}
19
- }
20
-
21
- export class EventData {
22
- constructor(
23
- public event: Event,
24
- public block: HeaderOnlyBlock,
25
- public tx: TransactionContext,
26
- ) {}
27
- }
28
-
29
- export class TransactionData {
30
- constructor(
31
- public tx: TxResult,
32
- public block: HeaderOnlyBlock,
33
- ) {}
34
- }
35
-
36
- export class MessageData {
37
- constructor(
38
- public message: Any,
39
- public block: HeaderOnlyBlock,
40
- public tx: TransactionContext,
41
- ) {}
42
- }
43
-
44
- export class TransactionContext {
45
- constructor(
46
- public hash: Bytes,
47
- public index: u32,
48
- public code: u32,
49
- public gasWanted: i64,
50
- public gasUsed: i64,
51
- ) {}
52
- }
53
-
54
- export class Header {
55
- constructor(
56
- public version: Consensus,
57
- public chainId: string,
58
- public height: u64,
59
- public time: Timestamp,
60
- public lastBlockId: BlockID,
61
- public lastCommitHash: Bytes,
62
- public dataHash: Bytes,
63
- public validatorsHash: Bytes,
64
- public nextValidatorsHash: Bytes,
65
- public consensusHash: Bytes,
66
- public appHash: Bytes,
67
- public lastResultsHash: Bytes,
68
- public evidenceHash: Bytes,
69
- public proposerAddress: Bytes,
70
- public hash: Bytes,
71
- ) {}
72
- }
73
-
74
- export class Consensus {
75
- constructor(
76
- public block: u64,
77
- public app: u64,
78
- ) {}
79
- }
80
-
81
- export class Timestamp {
82
- constructor(
83
- public seconds: i64,
84
- public nanos: i32,
85
- ) {}
86
- }
87
-
88
- export class BlockID {
89
- constructor(
90
- public hash: Bytes,
91
- public partSetHeader: PartSetHeader,
92
- ) {}
93
- }
94
-
95
- export class PartSetHeader {
96
- constructor(
97
- public total: u32,
98
- public hash: Bytes,
99
- ) {}
100
- }
101
-
102
- export class EvidenceList {
103
- constructor(public evidence: Array<Evidence>) {}
104
- }
105
-
106
- export class Evidence {
107
- constructor(
108
- public duplicateVoteEvidence: DuplicateVoteEvidence,
109
- public lightClientAttackEvidence: LightClientAttackEvidence,
110
- ) {}
111
- }
112
-
113
- export class DuplicateVoteEvidence {
114
- constructor(
115
- public voteA: EventVote,
116
- public voteB: EventVote,
117
- public totalVotingPower: i64,
118
- public validatorPower: i64,
119
- public timestamp: Timestamp,
120
- ) {}
121
- }
122
-
123
- export class EventVote {
124
- constructor(
125
- public eventVoteType: SignedMsgType,
126
- public height: u64,
127
- public round: i32,
128
- public blockId: BlockID,
129
- public timestamp: Timestamp,
130
- public validatorAddress: Bytes,
131
- public validatorIndex: i32,
132
- public signature: Bytes,
133
- ) {}
134
- }
135
-
136
- export enum SignedMsgType {
137
- SIGNED_MSG_TYPE_UNKNOWN = 0,
138
- SIGNED_MSG_TYPE_PREVOTE = 1,
139
- SIGNED_MSG_TYPE_PRECOMMIT = 2,
140
- SIGNED_MSG_TYPE_PROPOSAL = 32,
141
- }
142
-
143
- export class LightClientAttackEvidence {
144
- constructor(
145
- public conflictingBlock: LightBlock,
146
- public commonHeight: i64,
147
- public byzantineValidators: Array<Validator>,
148
- public totalVotingPower: i64,
149
- public timestamp: Timestamp,
150
- ) {}
151
- }
152
-
153
- export class LightBlock {
154
- constructor(
155
- public signedHeader: SignedHeader,
156
- public validatorSet: ValidatorSet,
157
- ) {}
158
- }
159
-
160
- export class SignedHeader {
161
- constructor(
162
- public header: Header,
163
- public commit: Commit,
164
- ) {}
165
- }
166
-
167
- export class Commit {
168
- constructor(
169
- public height: i64,
170
- public round: i32,
171
- public blockId: BlockID,
172
- public signatures: Array<CommitSig>,
173
- ) {}
174
- }
175
-
176
- export class CommitSig {
177
- constructor(
178
- public blockIdFlag: BlockIDFlag,
179
- public validatorAddress: Bytes,
180
- public timestamp: Timestamp,
181
- public signature: Bytes,
182
- ) {}
183
- }
184
-
185
- export enum BlockIDFlag {
186
- BLOCK_ID_FLAG_UNKNOWN = 0,
187
- BLOCK_ID_FLAG_ABSENT = 1,
188
- BLOCK_ID_FLAG_COMMIT = 2,
189
- BLOCK_ID_FLAG_NIL = 3,
190
- }
191
-
192
- export class ValidatorSet {
193
- constructor(
194
- public validators: Array<Validator>,
195
- public proposer: Validator,
196
- public totalVotingPower: i64,
197
- ) {}
198
- }
199
-
200
- export class Validator {
201
- constructor(
202
- public address: Bytes,
203
- public pubKey: PublicKey,
204
- public votingPower: i64,
205
- public proposerPriority: i64,
206
- ) {}
207
- }
208
-
209
- export class PublicKey {
210
- constructor(
211
- public ed25519: Bytes,
212
- public secp256k1: Bytes,
213
- ) {}
214
- }
215
-
216
- export class ResponseBeginBlock {
217
- constructor(public events: Array<Event>) {}
218
- }
219
-
220
- export class Event {
221
- constructor(
222
- public eventType: string,
223
- public attributes: Array<EventAttribute>,
224
- ) {}
225
-
226
- getAttribute(key: string): EventAttribute | null {
227
- for (let i = 0; i < this.attributes.length; i++) {
228
- if (this.attributes[i].key == key) {
229
- return this.attributes[i];
230
- }
231
- }
232
- return null;
233
- }
234
-
235
- getAttributeValue(key: string): string {
236
- const attribute = this.getAttribute(key);
237
- return attribute ? attribute.value : '';
238
- }
239
- }
240
-
241
- export class EventAttribute {
242
- constructor(
243
- public key: string,
244
- public value: string,
245
- public index: bool,
246
- ) {}
247
- }
248
-
249
- export class ResponseEndBlock {
250
- constructor(
251
- public validatorUpdates: Array<ValidatorUpdate>,
252
- public consensusParamUpdates: ConsensusParams,
253
- public events: Array<Event>,
254
- ) {}
255
- }
256
-
257
- export class ValidatorUpdate {
258
- constructor(
259
- public address: Bytes,
260
- public pubKey: PublicKey,
261
- public power: i64,
262
- ) {}
263
- }
264
-
265
- export class ConsensusParams {
266
- constructor(
267
- public block: BlockParams,
268
- public evidence: EvidenceParams,
269
- public validator: ValidatorParams,
270
- public version: VersionParams,
271
- ) {}
272
- }
273
-
274
- export class BlockParams {
275
- constructor(
276
- public maxBytes: i64,
277
- public maxGas: i64,
278
- ) {}
279
- }
280
-
281
- export class EvidenceParams {
282
- constructor(
283
- public maxAgeNumBlocks: i64,
284
- public maxAgeDuration: Duration,
285
- public maxBytes: i64,
286
- ) {}
287
- }
288
-
289
- export class Duration {
290
- constructor(
291
- public seconds: i64,
292
- public nanos: i32,
293
- ) {}
294
- }
295
-
296
- export class ValidatorParams {
297
- constructor(public pubKeyTypes: Array<string>) {}
298
- }
299
-
300
- export class VersionParams {
301
- constructor(public appVersion: u64) {}
302
- }
303
-
304
- export class TxResult {
305
- constructor(
306
- public height: u64,
307
- public index: u32,
308
- public tx: Tx,
309
- public result: ResponseDeliverTx,
310
- public hash: Bytes,
311
- ) {}
312
- }
313
-
314
- export class Tx {
315
- constructor(
316
- public body: TxBody,
317
- public authInfo: AuthInfo,
318
- public signatures: Array<Bytes>,
319
- ) {}
320
- }
321
-
322
- export class TxBody {
323
- constructor(
324
- public messages: Array<Any>,
325
- public memo: string,
326
- public timeoutHeight: u64,
327
- public extensionOptions: Array<Any>,
328
- public nonCriticalExtensionOptions: Array<Any>,
329
- ) {}
330
- }
331
-
332
- export class Any {
333
- constructor(
334
- public typeUrl: string,
335
- public value: Bytes,
336
- ) {}
337
- }
338
-
339
- export class AuthInfo {
340
- constructor(
341
- public signerInfos: Array<SignerInfo>,
342
- public fee: Fee,
343
- public tip: Tip,
344
- ) {}
345
- }
346
-
347
- export class SignerInfo {
348
- constructor(
349
- public publicKey: Any,
350
- public modeInfo: ModeInfo,
351
- public sequence: u64,
352
- ) {}
353
- }
354
-
355
- export class ModeInfo {
356
- constructor(
357
- public single: ModeInfoSingle,
358
- public multi: ModeInfoMulti,
359
- ) {}
360
- }
361
-
362
- export class ModeInfoSingle {
363
- constructor(public mode: SignMode) {}
364
- }
365
-
366
- export enum SignMode {
367
- SIGN_MODE_UNSPECIFIED = 0,
368
- SIGN_MODE_DIRECT = 1,
369
- SIGN_MODE_TEXTUAL = 2,
370
- SIGN_MODE_LEGACY_AMINO_JSON = 127,
371
- }
372
-
373
- export class ModeInfoMulti {
374
- constructor(
375
- public bitarray: CompactBitArray,
376
- public modeInfos: Array<ModeInfo>,
377
- ) {}
378
- }
379
-
380
- export class CompactBitArray {
381
- constructor(
382
- public extraBitsStored: u32,
383
- public elems: Bytes,
384
- ) {}
385
- }
386
-
387
- export class Fee {
388
- constructor(
389
- public amount: Array<Coin>,
390
- public gasLimit: u64,
391
- public payer: string,
392
- public granter: string,
393
- ) {}
394
- }
395
-
396
- export class Coin {
397
- constructor(
398
- public denom: string,
399
- public amount: string,
400
- ) {}
401
- }
402
-
403
- export class Tip {
404
- constructor(
405
- public amount: Array<Coin>,
406
- public tipper: string,
407
- ) {}
408
- }
409
-
410
- export class ResponseDeliverTx {
411
- constructor(
412
- public code: u32,
413
- public data: Bytes,
414
- public log: string,
415
- public info: string,
416
- public gasWanted: i64,
417
- public gasUsed: i64,
418
- public events: Array<Event>,
419
- public codespace: string,
420
- ) {}
421
- }
422
-
423
- export class ValidatorSetUpdates {
424
- constructor(public validatorUpdates: Array<Validator>) {}
425
- }
426
- }