@nexus-cross/pop 1.3.10-beta.2

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.
@@ -0,0 +1,984 @@
1
+ {
2
+ "schemes": [],
3
+ "swagger": "2.0",
4
+ "info": {
5
+ "description": "Social-identifier based on-chain asset transfer API",
6
+ "title": "One Pop API",
7
+ "contact": {},
8
+ "version": "v.0.1.0"
9
+ },
10
+ "host": "",
11
+ "basePath": "/api",
12
+ "paths": {
13
+ "/batch-claim-signature": {
14
+ "post": {
15
+ "security": [
16
+ {
17
+ "BearerAuth": []
18
+ }
19
+ ],
20
+ "description": "Returns an EIP-712 ValidatorClaim signature bound to the SIWE-authenticated address as recipient. The caller must prove ownership of id via an X OAuth token in the body; recipient always comes from the bearer token, never the body. nonce/deadline are supplied by the caller (read from validatorNonceById on-chain). The signature remains valid across paginated withdrawByValidator calls until the id's live drops are fully drained — reuse it instead of re-requesting per page.",
21
+ "consumes": [
22
+ "application/json"
23
+ ],
24
+ "produces": [
25
+ "application/json"
26
+ ],
27
+ "tags": [
28
+ "batch-claim"
29
+ ],
30
+ "summary": "Issue a SafeDrop batch-claim validator signature",
31
+ "parameters": [
32
+ {
33
+ "description": "batch-claim signature request",
34
+ "name": "request",
35
+ "in": "body",
36
+ "required": true,
37
+ "schema": {
38
+ "$ref": "#/definitions/types.BatchClaimSignReq"
39
+ }
40
+ }
41
+ ],
42
+ "responses": {
43
+ "200": {
44
+ "description": "OK",
45
+ "schema": {
46
+ "$ref": "#/definitions/types.BatchClaimSignResp"
47
+ }
48
+ },
49
+ "400": {
50
+ "description": "10001 INVALID_PARAM",
51
+ "schema": {
52
+ "$ref": "#/definitions/handler.errorBody"
53
+ }
54
+ },
55
+ "401": {
56
+ "description": "20003 UNAUTHORIZED",
57
+ "schema": {
58
+ "$ref": "#/definitions/handler.errorBody"
59
+ }
60
+ },
61
+ "429": {
62
+ "description": "10003 RATE_LIMITED",
63
+ "schema": {
64
+ "$ref": "#/definitions/handler.errorBody"
65
+ }
66
+ },
67
+ "500": {
68
+ "description": "10002 INTERNAL (enclave error)",
69
+ "schema": {
70
+ "$ref": "#/definitions/handler.errorBody"
71
+ }
72
+ }
73
+ }
74
+ }
75
+ },
76
+ "/drops": {
77
+ "get": {
78
+ "security": [
79
+ {
80
+ "BearerAuth": []
81
+ }
82
+ ],
83
+ "description": "Resolves the caller's handle from their active X connection (POST /x-connections) — no per-request X token. Senders with an active X connection carry handle/profile; others are address-only. has_claimed_before gates the batch-claim CTA. amount/total_amount are wei decimal strings.",
84
+ "produces": [
85
+ "application/json"
86
+ ],
87
+ "tags": [
88
+ "drops"
89
+ ],
90
+ "summary": "List pending drops addressed to the caller (claim inbox)",
91
+ "parameters": [
92
+ {
93
+ "type": "string",
94
+ "description": "ERC20 token address filter (0x hex)",
95
+ "name": "token",
96
+ "in": "query"
97
+ }
98
+ ],
99
+ "responses": {
100
+ "200": {
101
+ "description": "OK",
102
+ "schema": {
103
+ "$ref": "#/definitions/types.DropsResp"
104
+ }
105
+ },
106
+ "400": {
107
+ "description": "10001 INVALID_PARAM",
108
+ "schema": {
109
+ "$ref": "#/definitions/handler.errorBody"
110
+ }
111
+ },
112
+ "401": {
113
+ "description": "20003 UNAUTHORIZED",
114
+ "schema": {
115
+ "$ref": "#/definitions/handler.errorBody"
116
+ }
117
+ },
118
+ "404": {
119
+ "description": "40002 X_CONNECTION_NOT_FOUND",
120
+ "schema": {
121
+ "$ref": "#/definitions/handler.errorBody"
122
+ }
123
+ },
124
+ "500": {
125
+ "description": "10002 INTERNAL",
126
+ "schema": {
127
+ "$ref": "#/definitions/handler.errorBody"
128
+ }
129
+ }
130
+ }
131
+ }
132
+ },
133
+ "/envelopes": {
134
+ "get": {
135
+ "description": "Public endpoint. Returns active envelopes within their display window, sorted. name resolves by locale with English fallback.",
136
+ "produces": [
137
+ "application/json"
138
+ ],
139
+ "tags": [
140
+ "envelopes"
141
+ ],
142
+ "summary": "List available envelopes (card designs)",
143
+ "parameters": [
144
+ {
145
+ "type": "string",
146
+ "description": "locale for names (default en)",
147
+ "name": "locale",
148
+ "in": "query"
149
+ }
150
+ ],
151
+ "responses": {
152
+ "200": {
153
+ "description": "OK",
154
+ "schema": {
155
+ "$ref": "#/definitions/types.EnvelopesResp"
156
+ }
157
+ },
158
+ "500": {
159
+ "description": "10002 INTERNAL",
160
+ "schema": {
161
+ "$ref": "#/definitions/handler.errorBody"
162
+ }
163
+ }
164
+ }
165
+ }
166
+ },
167
+ "/events/subscribe": {
168
+ "get": {
169
+ "description": "Server-Sent Events stream broadcast to every connected client. Frames are \"event: withdrawn\" with data matching the spec §6.2 message (amount is wei as a decimal string); \": ping\" comments keep the connection alive. Delivery is best-effort — missed events are recoverable via GET /histories.",
170
+ "produces": [
171
+ "text/event-stream"
172
+ ],
173
+ "tags": [
174
+ "events"
175
+ ],
176
+ "summary": "Subscribe to withdrawn (claim) notifications (SSE)",
177
+ "responses": {
178
+ "200": {
179
+ "description": "SSE stream",
180
+ "schema": {
181
+ "type": "string"
182
+ }
183
+ },
184
+ "503": {
185
+ "description": "50001 SSE_UNAVAILABLE",
186
+ "schema": {
187
+ "$ref": "#/definitions/handler.errorBody"
188
+ }
189
+ }
190
+ }
191
+ }
192
+ },
193
+ "/histories": {
194
+ "get": {
195
+ "security": [
196
+ {
197
+ "BearerAuth": []
198
+ }
199
+ ],
200
+ "description": "Returns scanner-collected SafeDrop events (Deposited/Withdrawn/Refunded) where the authenticated SIWE address is the sender (from_address) or the final recipient (to_address), newest first. The queried address always comes from the bearer token; it cannot be chosen by the caller. amount is wei as a decimal string.",
201
+ "produces": [
202
+ "application/json"
203
+ ],
204
+ "tags": [
205
+ "histories"
206
+ ],
207
+ "summary": "List the caller's on-chain history",
208
+ "parameters": [
209
+ {
210
+ "enum": [
211
+ "Deposited",
212
+ "Withdrawn",
213
+ "Refunded",
214
+ "BatchWithdrawn"
215
+ ],
216
+ "type": "string",
217
+ "description": "event name filter",
218
+ "name": "event",
219
+ "in": "query"
220
+ },
221
+ {
222
+ "type": "integer",
223
+ "description": "1-based page (default 1)",
224
+ "name": "page",
225
+ "in": "query"
226
+ },
227
+ {
228
+ "type": "integer",
229
+ "description": "page size (default 20, max 100)",
230
+ "name": "page_size",
231
+ "in": "query"
232
+ }
233
+ ],
234
+ "responses": {
235
+ "200": {
236
+ "description": "OK",
237
+ "schema": {
238
+ "$ref": "#/definitions/types.HistoryResp"
239
+ }
240
+ },
241
+ "400": {
242
+ "description": "10001 INVALID_PARAM",
243
+ "schema": {
244
+ "$ref": "#/definitions/handler.errorBody"
245
+ }
246
+ },
247
+ "401": {
248
+ "description": "20003 UNAUTHORIZED",
249
+ "schema": {
250
+ "$ref": "#/definitions/handler.errorBody"
251
+ }
252
+ },
253
+ "500": {
254
+ "description": "10002 INTERNAL",
255
+ "schema": {
256
+ "$ref": "#/definitions/handler.errorBody"
257
+ }
258
+ }
259
+ }
260
+ }
261
+ },
262
+ "/leaderboards": {
263
+ "get": {
264
+ "description": "Returns up to 10 identifiers ordered by pending (claimable) amount of the given ERC20 token, descending (identifier ascending as tiebreak), maintained from Deposited/Withdrawn/Refunded events. balance and last_deposit_amount are wei as decimal strings. Public endpoint.",
265
+ "produces": [
266
+ "application/json"
267
+ ],
268
+ "tags": [
269
+ "leaderboards"
270
+ ],
271
+ "summary": "Top pending balances per identifier",
272
+ "parameters": [
273
+ {
274
+ "type": "string",
275
+ "description": "ERC20 token address (0x hex)",
276
+ "name": "token",
277
+ "in": "query",
278
+ "required": true
279
+ }
280
+ ],
281
+ "responses": {
282
+ "200": {
283
+ "description": "OK",
284
+ "schema": {
285
+ "$ref": "#/definitions/types.LeaderboardResp"
286
+ }
287
+ },
288
+ "400": {
289
+ "description": "10001 INVALID_PARAM",
290
+ "schema": {
291
+ "$ref": "#/definitions/handler.errorBody"
292
+ }
293
+ },
294
+ "500": {
295
+ "description": "10002 INTERNAL",
296
+ "schema": {
297
+ "$ref": "#/definitions/handler.errorBody"
298
+ }
299
+ }
300
+ }
301
+ }
302
+ },
303
+ "/wallets": {
304
+ "post": {
305
+ "security": [
306
+ {
307
+ "BearerAuth": []
308
+ }
309
+ ],
310
+ "description": "Generates a secp256k1 keypair for (sender_address, oauth_type, identifier), stores the AES-256-GCM-encrypted private key, and returns the new wallet address. Multiple pending wallets may exist for the same combination (a sender may create multiple drops to the same recipient). message (\u003c=140 runes) and envelope_id are optional drop metadata shown to the recipient at claim.",
311
+ "consumes": [
312
+ "application/json"
313
+ ],
314
+ "produces": [
315
+ "application/json"
316
+ ],
317
+ "tags": [
318
+ "wallets"
319
+ ],
320
+ "summary": "Create a temporary wallet",
321
+ "parameters": [
322
+ {
323
+ "description": "wallet creation request",
324
+ "name": "request",
325
+ "in": "body",
326
+ "required": true,
327
+ "schema": {
328
+ "$ref": "#/definitions/types.CreateReq"
329
+ }
330
+ }
331
+ ],
332
+ "responses": {
333
+ "201": {
334
+ "description": "Created",
335
+ "schema": {
336
+ "$ref": "#/definitions/types.CreateResp"
337
+ }
338
+ },
339
+ "400": {
340
+ "description": "10001 INVALID_PARAM",
341
+ "schema": {
342
+ "$ref": "#/definitions/handler.errorBody"
343
+ }
344
+ },
345
+ "401": {
346
+ "description": "20003 UNAUTHORIZED (missing/invalid token, or sender_address not owned by the token)",
347
+ "schema": {
348
+ "$ref": "#/definitions/handler.errorBody"
349
+ }
350
+ },
351
+ "403": {
352
+ "description": "30003 SEND_BLOCKED",
353
+ "schema": {
354
+ "$ref": "#/definitions/handler.errorBody"
355
+ }
356
+ },
357
+ "404": {
358
+ "description": "30004 ENVELOPE_NOT_FOUND",
359
+ "schema": {
360
+ "$ref": "#/definitions/handler.errorBody"
361
+ }
362
+ },
363
+ "409": {
364
+ "description": "30005 PENDING_LIMIT_EXCEEDED",
365
+ "schema": {
366
+ "$ref": "#/definitions/handler.errorBody"
367
+ }
368
+ },
369
+ "500": {
370
+ "description": "10002 INTERNAL",
371
+ "schema": {
372
+ "$ref": "#/definitions/handler.errorBody"
373
+ }
374
+ }
375
+ }
376
+ }
377
+ },
378
+ "/wallets/private-key": {
379
+ "post": {
380
+ "description": "Identifies the caller through the X OAuth token (the token owner's username is the wallet identifier) and returns the decrypted private key of the latest pending wallet addressed to them for sender_address. oauth_token must be an X OAuth 2.0 user-context access token issued with the tweet.read and users.read scopes (app-only bearer tokens are rejected). Point of no return: once returned, key custody is the client's responsibility.",
381
+ "consumes": [
382
+ "application/json"
383
+ ],
384
+ "produces": [
385
+ "application/json"
386
+ ],
387
+ "tags": [
388
+ "wallets"
389
+ ],
390
+ "summary": "Retrieve a pending wallet's private key",
391
+ "parameters": [
392
+ {
393
+ "description": "private key retrieval request",
394
+ "name": "request",
395
+ "in": "body",
396
+ "required": true,
397
+ "schema": {
398
+ "$ref": "#/definitions/types.RetrievePrivateKeyReq"
399
+ }
400
+ }
401
+ ],
402
+ "responses": {
403
+ "200": {
404
+ "description": "OK",
405
+ "schema": {
406
+ "$ref": "#/definitions/types.RetrievePrivateKeyResp"
407
+ }
408
+ },
409
+ "400": {
410
+ "description": "10001 INVALID_PARAM",
411
+ "schema": {
412
+ "$ref": "#/definitions/handler.errorBody"
413
+ }
414
+ },
415
+ "401": {
416
+ "description": "20001 INVALID_OAUTH_TOKEN",
417
+ "schema": {
418
+ "$ref": "#/definitions/handler.errorBody"
419
+ }
420
+ },
421
+ "404": {
422
+ "description": "30001 WALLET_NOT_FOUND",
423
+ "schema": {
424
+ "$ref": "#/definitions/handler.errorBody"
425
+ }
426
+ },
427
+ "429": {
428
+ "description": "10003 RATE_LIMITED",
429
+ "schema": {
430
+ "$ref": "#/definitions/handler.errorBody"
431
+ }
432
+ },
433
+ "500": {
434
+ "description": "10002 INTERNAL",
435
+ "schema": {
436
+ "$ref": "#/definitions/handler.errorBody"
437
+ }
438
+ }
439
+ }
440
+ }
441
+ },
442
+ "/x-connections": {
443
+ "get": {
444
+ "security": [
445
+ {
446
+ "BearerAuth": []
447
+ }
448
+ ],
449
+ "produces": [
450
+ "application/json"
451
+ ],
452
+ "tags": [
453
+ "x-connections"
454
+ ],
455
+ "summary": "Get the caller's active X connection",
456
+ "responses": {
457
+ "200": {
458
+ "description": "OK",
459
+ "schema": {
460
+ "$ref": "#/definitions/types.XConnectionResp"
461
+ }
462
+ },
463
+ "401": {
464
+ "description": "20003 UNAUTHORIZED",
465
+ "schema": {
466
+ "$ref": "#/definitions/handler.errorBody"
467
+ }
468
+ },
469
+ "404": {
470
+ "description": "40002 X_CONNECTION_NOT_FOUND",
471
+ "schema": {
472
+ "$ref": "#/definitions/handler.errorBody"
473
+ }
474
+ },
475
+ "500": {
476
+ "description": "10002 INTERNAL",
477
+ "schema": {
478
+ "$ref": "#/definitions/handler.errorBody"
479
+ }
480
+ }
481
+ }
482
+ },
483
+ "post": {
484
+ "security": [
485
+ {
486
+ "BearerAuth": []
487
+ }
488
+ ],
489
+ "description": "Verifies the X OAuth token server-side (GET /2/users/me) and upserts the x_user_id -\u003e wallet mapping (latest connection wins). The wallet is always the SIWE-authenticated address.",
490
+ "consumes": [
491
+ "application/json"
492
+ ],
493
+ "produces": [
494
+ "application/json"
495
+ ],
496
+ "tags": [
497
+ "x-connections"
498
+ ],
499
+ "summary": "Connect the caller's X account to their wallet",
500
+ "parameters": [
501
+ {
502
+ "description": "X connect request",
503
+ "name": "request",
504
+ "in": "body",
505
+ "required": true,
506
+ "schema": {
507
+ "$ref": "#/definitions/types.XConnectReq"
508
+ }
509
+ }
510
+ ],
511
+ "responses": {
512
+ "200": {
513
+ "description": "OK",
514
+ "schema": {
515
+ "$ref": "#/definitions/types.XConnectionResp"
516
+ }
517
+ },
518
+ "400": {
519
+ "description": "10001 INVALID_PARAM",
520
+ "schema": {
521
+ "$ref": "#/definitions/handler.errorBody"
522
+ }
523
+ },
524
+ "401": {
525
+ "description": "20001 INVALID_OAUTH_TOKEN / 20003 UNAUTHORIZED",
526
+ "schema": {
527
+ "$ref": "#/definitions/handler.errorBody"
528
+ }
529
+ },
530
+ "429": {
531
+ "description": "10003 RATE_LIMITED",
532
+ "schema": {
533
+ "$ref": "#/definitions/handler.errorBody"
534
+ }
535
+ },
536
+ "500": {
537
+ "description": "10002 INTERNAL",
538
+ "schema": {
539
+ "$ref": "#/definitions/handler.errorBody"
540
+ }
541
+ }
542
+ }
543
+ },
544
+ "delete": {
545
+ "security": [
546
+ {
547
+ "BearerAuth": []
548
+ }
549
+ ],
550
+ "tags": [
551
+ "x-connections"
552
+ ],
553
+ "summary": "Sign out of X (disconnect)",
554
+ "responses": {
555
+ "204": {
556
+ "description": "no content",
557
+ "schema": {
558
+ "type": "string"
559
+ }
560
+ },
561
+ "401": {
562
+ "description": "20003 UNAUTHORIZED",
563
+ "schema": {
564
+ "$ref": "#/definitions/handler.errorBody"
565
+ }
566
+ },
567
+ "404": {
568
+ "description": "40002 X_CONNECTION_NOT_FOUND",
569
+ "schema": {
570
+ "$ref": "#/definitions/handler.errorBody"
571
+ }
572
+ },
573
+ "500": {
574
+ "description": "10002 INTERNAL",
575
+ "schema": {
576
+ "$ref": "#/definitions/handler.errorBody"
577
+ }
578
+ }
579
+ }
580
+ }
581
+ }
582
+ },
583
+ "definitions": {
584
+ "handler.errorBody": {
585
+ "type": "object",
586
+ "properties": {
587
+ "code": {
588
+ "type": "integer"
589
+ },
590
+ "code_name": {
591
+ "type": "string"
592
+ },
593
+ "message": {
594
+ "type": "string"
595
+ }
596
+ }
597
+ },
598
+ "types.BatchClaimSignReq": {
599
+ "type": "object",
600
+ "required": [
601
+ "deadline",
602
+ "id",
603
+ "nonce",
604
+ "oauth_token"
605
+ ],
606
+ "properties": {
607
+ "deadline": {
608
+ "type": "string"
609
+ },
610
+ "id": {
611
+ "type": "string"
612
+ },
613
+ "nonce": {
614
+ "type": "string"
615
+ },
616
+ "oauth_token": {
617
+ "type": "string"
618
+ }
619
+ }
620
+ },
621
+ "types.BatchClaimSignResp": {
622
+ "type": "object",
623
+ "properties": {
624
+ "deadline": {
625
+ "type": "string"
626
+ },
627
+ "id": {
628
+ "type": "string"
629
+ },
630
+ "nonce": {
631
+ "type": "string"
632
+ },
633
+ "recipient": {
634
+ "type": "string"
635
+ },
636
+ "signature": {
637
+ "type": "string"
638
+ }
639
+ }
640
+ },
641
+ "types.CreateReq": {
642
+ "type": "object",
643
+ "required": [
644
+ "identifier",
645
+ "oauth_type",
646
+ "sender_address"
647
+ ],
648
+ "properties": {
649
+ "envelope_id": {
650
+ "description": "EnvelopeID selects the card design (GET /envelopes).",
651
+ "type": "string",
652
+ "example": "classic-coral"
653
+ },
654
+ "identifier": {
655
+ "type": "string",
656
+ "example": "@theo_13303"
657
+ },
658
+ "message": {
659
+ "description": "Message is shown to the recipient at claim (\u003c= 140 runes).\nStored server-side only — the contract has no message field.",
660
+ "type": "string",
661
+ "example": "Happy birthday!"
662
+ },
663
+ "oauth_type": {
664
+ "type": "string",
665
+ "example": "x"
666
+ },
667
+ "sender_address": {
668
+ "type": "string",
669
+ "example": "0x1111111111111111111111111111111111111111"
670
+ }
671
+ }
672
+ },
673
+ "types.CreateResp": {
674
+ "type": "object",
675
+ "properties": {
676
+ "address": {
677
+ "type": "string",
678
+ "example": "0x2222222222222222222222222222222222222222"
679
+ }
680
+ }
681
+ },
682
+ "types.DropItem": {
683
+ "type": "object",
684
+ "properties": {
685
+ "amount": {
686
+ "description": "Amount is wei as a decimal string.",
687
+ "type": "string",
688
+ "example": "125000000000000000000"
689
+ },
690
+ "claim_address": {
691
+ "type": "string",
692
+ "example": "0x2222222222222222222222222222222222222222"
693
+ },
694
+ "deposited_at": {
695
+ "type": "string"
696
+ },
697
+ "envelope_id": {
698
+ "type": "string",
699
+ "example": "classic-coral"
700
+ },
701
+ "message": {
702
+ "type": "string",
703
+ "example": "Happy birthday!"
704
+ },
705
+ "sender": {
706
+ "$ref": "#/definitions/types.DropSender"
707
+ },
708
+ "token": {
709
+ "type": "string",
710
+ "example": "0x3333333333333333333333333333333333333333"
711
+ }
712
+ }
713
+ },
714
+ "types.DropSender": {
715
+ "type": "object",
716
+ "properties": {
717
+ "address": {
718
+ "type": "string",
719
+ "example": "0x1111111111111111111111111111111111111111"
720
+ },
721
+ "display_name": {
722
+ "type": "string",
723
+ "example": "Amy Ryoon"
724
+ },
725
+ "handle": {
726
+ "description": "Handle/DisplayName/ProfileImageURL are empty when the sponsor has\nno active X connection (address-only sender per the UI spec).",
727
+ "type": "string",
728
+ "example": "amyhryoon"
729
+ },
730
+ "profile_image_url": {
731
+ "type": "string",
732
+ "example": "https://pbs.twimg.com/..."
733
+ }
734
+ }
735
+ },
736
+ "types.DropsResp": {
737
+ "type": "object",
738
+ "properties": {
739
+ "count": {
740
+ "type": "integer",
741
+ "example": 3
742
+ },
743
+ "has_claimed_before": {
744
+ "description": "HasClaimedBefore gates the batch-claim CTA (first claim must be\nan individual claim per the UI spec).",
745
+ "type": "boolean",
746
+ "example": true
747
+ },
748
+ "items": {
749
+ "type": "array",
750
+ "items": {
751
+ "$ref": "#/definitions/types.DropItem"
752
+ }
753
+ },
754
+ "total_amount": {
755
+ "description": "TotalAmount is the pending sum in wei as a decimal string.",
756
+ "type": "string",
757
+ "example": "187500000000000000000"
758
+ }
759
+ }
760
+ },
761
+ "types.EnvelopeItem": {
762
+ "type": "object",
763
+ "properties": {
764
+ "badge": {
765
+ "type": "string",
766
+ "example": "limited"
767
+ },
768
+ "id": {
769
+ "type": "string",
770
+ "example": "classic-coral"
771
+ },
772
+ "image_url": {
773
+ "type": "string",
774
+ "example": "https://cdn.example.com/envelopes/classic-coral.png"
775
+ },
776
+ "name": {
777
+ "type": "string",
778
+ "example": "Classic Coral"
779
+ },
780
+ "sort_order": {
781
+ "type": "integer",
782
+ "example": 10
783
+ }
784
+ }
785
+ },
786
+ "types.EnvelopesResp": {
787
+ "type": "object",
788
+ "properties": {
789
+ "items": {
790
+ "type": "array",
791
+ "items": {
792
+ "$ref": "#/definitions/types.EnvelopeItem"
793
+ }
794
+ }
795
+ }
796
+ },
797
+ "types.HistoryItem": {
798
+ "type": "object",
799
+ "properties": {
800
+ "amount": {
801
+ "description": "Amount is wei as a decimal string (JS number precision safety).",
802
+ "type": "string",
803
+ "example": "1000000000000000000"
804
+ },
805
+ "block_number": {
806
+ "type": "integer",
807
+ "example": 12345678
808
+ },
809
+ "contract_address": {
810
+ "type": "string",
811
+ "example": "0x3333333333333333333333333333333333333333"
812
+ },
813
+ "created_at": {
814
+ "type": "string"
815
+ },
816
+ "event_name": {
817
+ "type": "string",
818
+ "example": "Withdrawn"
819
+ },
820
+ "from_address": {
821
+ "description": "FromAddress/TempTo/ToAddress are null when the event doesn't carry them.",
822
+ "type": "string",
823
+ "example": "0x1111111111111111111111111111111111111111"
824
+ },
825
+ "identifier": {
826
+ "type": "string",
827
+ "example": "theo_13303"
828
+ },
829
+ "log_index": {
830
+ "type": "integer",
831
+ "example": 0
832
+ },
833
+ "payload": {
834
+ "type": "object"
835
+ },
836
+ "temp_to": {
837
+ "type": "string",
838
+ "example": "0x2222222222222222222222222222222222222222"
839
+ },
840
+ "to_address": {
841
+ "type": "string",
842
+ "example": "0x5555555555555555555555555555555555555555"
843
+ },
844
+ "tx_hash": {
845
+ "type": "string",
846
+ "example": "0x9f2c...ab"
847
+ }
848
+ }
849
+ },
850
+ "types.HistoryResp": {
851
+ "type": "object",
852
+ "properties": {
853
+ "items": {
854
+ "type": "array",
855
+ "items": {
856
+ "$ref": "#/definitions/types.HistoryItem"
857
+ }
858
+ },
859
+ "page": {
860
+ "type": "integer",
861
+ "example": 1
862
+ },
863
+ "page_size": {
864
+ "type": "integer",
865
+ "example": 20
866
+ },
867
+ "total": {
868
+ "type": "integer",
869
+ "example": 42
870
+ }
871
+ }
872
+ },
873
+ "types.LeaderboardItem": {
874
+ "type": "object",
875
+ "properties": {
876
+ "balance": {
877
+ "description": "Balance is the pending (claimable) amount in wei as a decimal string.",
878
+ "type": "string",
879
+ "example": "12043000000000000000000"
880
+ },
881
+ "identifier": {
882
+ "type": "string",
883
+ "example": "realdonaldtrump"
884
+ },
885
+ "last_deposit_amount": {
886
+ "description": "LastDepositAmount is the most recent Deposited amount in wei.",
887
+ "type": "string",
888
+ "example": "1200000000000000000000"
889
+ }
890
+ }
891
+ },
892
+ "types.LeaderboardResp": {
893
+ "type": "object",
894
+ "properties": {
895
+ "items": {
896
+ "type": "array",
897
+ "items": {
898
+ "$ref": "#/definitions/types.LeaderboardItem"
899
+ }
900
+ }
901
+ }
902
+ },
903
+ "types.RetrievePrivateKeyReq": {
904
+ "type": "object",
905
+ "required": [
906
+ "oauth_token",
907
+ "oauth_type",
908
+ "sender_address"
909
+ ],
910
+ "properties": {
911
+ "oauth_token": {
912
+ "description": "OAuthToken is an X OAuth 2.0 USER-context access token. The client\n(frontend) must request the `tweet.read` and `users.read` scopes\nwhen issuing it — GET /2/users/me rejects tokens without them.\nApp-only bearer tokens do not work (401/403).",
913
+ "type": "string"
914
+ },
915
+ "oauth_type": {
916
+ "type": "string",
917
+ "example": "x"
918
+ },
919
+ "sender_address": {
920
+ "type": "string",
921
+ "example": "0x1111111111111111111111111111111111111111"
922
+ }
923
+ }
924
+ },
925
+ "types.RetrievePrivateKeyResp": {
926
+ "type": "object",
927
+ "properties": {
928
+ "address": {
929
+ "type": "string",
930
+ "example": "0x2222222222222222222222222222222222222222"
931
+ },
932
+ "private_key": {
933
+ "type": "string",
934
+ "example": "0x11223344556677889900aabbccddeeff11223344556677889900aabbccddeeff"
935
+ }
936
+ }
937
+ },
938
+ "types.XConnectReq": {
939
+ "type": "object",
940
+ "required": [
941
+ "oauth_token"
942
+ ],
943
+ "properties": {
944
+ "oauth_token": {
945
+ "description": "OAuthToken is an X OAuth 2.0 USER-context access token\n(tweet.read + users.read scopes; app-only tokens are rejected).",
946
+ "type": "string"
947
+ }
948
+ }
949
+ },
950
+ "types.XConnectionResp": {
951
+ "type": "object",
952
+ "properties": {
953
+ "display_name": {
954
+ "type": "string",
955
+ "example": "Theo"
956
+ },
957
+ "handle": {
958
+ "type": "string",
959
+ "example": "theo_13303"
960
+ },
961
+ "profile_image_url": {
962
+ "type": "string",
963
+ "example": "https://pbs.twimg.com/..."
964
+ },
965
+ "wallet_address": {
966
+ "type": "string",
967
+ "example": "0x1111111111111111111111111111111111111111"
968
+ },
969
+ "x_user_id": {
970
+ "type": "string",
971
+ "example": "12312"
972
+ }
973
+ }
974
+ }
975
+ },
976
+ "securityDefinitions": {
977
+ "BearerAuth": {
978
+ "description": "Platform JWT: \"Bearer {token}\" (verified via cross-auth)",
979
+ "type": "apiKey",
980
+ "name": "Authorization",
981
+ "in": "header"
982
+ }
983
+ }
984
+ }