@rotateprotocol/sdk 1.0.0

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 (74) hide show
  1. package/README.md +453 -0
  2. package/dist/catalog.d.ts +112 -0
  3. package/dist/catalog.d.ts.map +1 -0
  4. package/dist/catalog.js +210 -0
  5. package/dist/catalog.js.map +1 -0
  6. package/dist/components/CheckoutForm.d.ts +86 -0
  7. package/dist/components/CheckoutForm.d.ts.map +1 -0
  8. package/dist/components/CheckoutForm.js +332 -0
  9. package/dist/components/CheckoutForm.js.map +1 -0
  10. package/dist/components/HostedCheckout.d.ts +57 -0
  11. package/dist/components/HostedCheckout.d.ts.map +1 -0
  12. package/dist/components/HostedCheckout.js +414 -0
  13. package/dist/components/HostedCheckout.js.map +1 -0
  14. package/dist/components/PaymentButton.d.ts +80 -0
  15. package/dist/components/PaymentButton.d.ts.map +1 -0
  16. package/dist/components/PaymentButton.js +210 -0
  17. package/dist/components/PaymentButton.js.map +1 -0
  18. package/dist/components/RotateProvider.d.ts +115 -0
  19. package/dist/components/RotateProvider.d.ts.map +1 -0
  20. package/dist/components/RotateProvider.js +264 -0
  21. package/dist/components/RotateProvider.js.map +1 -0
  22. package/dist/components/index.d.ts +17 -0
  23. package/dist/components/index.d.ts.map +1 -0
  24. package/dist/components/index.js +27 -0
  25. package/dist/components/index.js.map +1 -0
  26. package/dist/embed.d.ts +85 -0
  27. package/dist/embed.d.ts.map +1 -0
  28. package/dist/embed.js +313 -0
  29. package/dist/embed.js.map +1 -0
  30. package/dist/hooks.d.ts +156 -0
  31. package/dist/hooks.d.ts.map +1 -0
  32. package/dist/hooks.js +280 -0
  33. package/dist/hooks.js.map +1 -0
  34. package/dist/idl/rotate_connect.json +2572 -0
  35. package/dist/index.d.ts +505 -0
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +1197 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/marketplace.d.ts +257 -0
  40. package/dist/marketplace.d.ts.map +1 -0
  41. package/dist/marketplace.js +433 -0
  42. package/dist/marketplace.js.map +1 -0
  43. package/dist/platform.d.ts +234 -0
  44. package/dist/platform.d.ts.map +1 -0
  45. package/dist/platform.js +268 -0
  46. package/dist/platform.js.map +1 -0
  47. package/dist/react.d.ts +140 -0
  48. package/dist/react.d.ts.map +1 -0
  49. package/dist/react.js +429 -0
  50. package/dist/react.js.map +1 -0
  51. package/dist/store.d.ts +213 -0
  52. package/dist/store.d.ts.map +1 -0
  53. package/dist/store.js +404 -0
  54. package/dist/store.js.map +1 -0
  55. package/dist/webhooks.d.ts +149 -0
  56. package/dist/webhooks.d.ts.map +1 -0
  57. package/dist/webhooks.js +371 -0
  58. package/dist/webhooks.js.map +1 -0
  59. package/package.json +114 -0
  60. package/src/catalog.ts +299 -0
  61. package/src/components/CheckoutForm.tsx +608 -0
  62. package/src/components/HostedCheckout.tsx +675 -0
  63. package/src/components/PaymentButton.tsx +348 -0
  64. package/src/components/RotateProvider.tsx +370 -0
  65. package/src/components/index.ts +26 -0
  66. package/src/embed.ts +408 -0
  67. package/src/hooks.ts +518 -0
  68. package/src/idl/rotate_connect.json +2572 -0
  69. package/src/index.ts +1538 -0
  70. package/src/marketplace.ts +642 -0
  71. package/src/platform.ts +403 -0
  72. package/src/react.ts +459 -0
  73. package/src/store.ts +577 -0
  74. package/src/webhooks.ts +506 -0
@@ -0,0 +1,2572 @@
1
+ {
2
+ "address": "ELBYdNeCGeMThC2ccckw3fyAt77SniV3gPTo1fuFcxDg",
3
+ "metadata": {
4
+ "name": "rotate_connect",
5
+ "version": "0.1.0",
6
+ "spec": "0.1.0",
7
+ "description": "Rotate Protocol - Payment routing on Solana"
8
+ },
9
+ "instructions": [
10
+ {
11
+ "name": "cancel_link",
12
+ "docs": [
13
+ "Cancel payment link - ONLY merchant wallet owner can cancel their own links"
14
+ ],
15
+ "discriminator": [
16
+ 24,
17
+ 199,
18
+ 194,
19
+ 250,
20
+ 228,
21
+ 31,
22
+ 137,
23
+ 113
24
+ ],
25
+ "accounts": [
26
+ {
27
+ "name": "merchant",
28
+ "pda": {
29
+ "seeds": [
30
+ {
31
+ "kind": "const",
32
+ "value": [
33
+ 109,
34
+ 101,
35
+ 114,
36
+ 99,
37
+ 104,
38
+ 97,
39
+ 110,
40
+ 116
41
+ ]
42
+ },
43
+ {
44
+ "kind": "account",
45
+ "path": "merchant.id",
46
+ "account": "Merchant"
47
+ }
48
+ ]
49
+ }
50
+ },
51
+ {
52
+ "name": "platform",
53
+ "pda": {
54
+ "seeds": [
55
+ {
56
+ "kind": "const",
57
+ "value": [
58
+ 112,
59
+ 108,
60
+ 97,
61
+ 116,
62
+ 102,
63
+ 111,
64
+ 114,
65
+ 109
66
+ ]
67
+ },
68
+ {
69
+ "kind": "account",
70
+ "path": "merchant.platform_id",
71
+ "account": "Merchant"
72
+ }
73
+ ]
74
+ }
75
+ },
76
+ {
77
+ "name": "link",
78
+ "writable": true,
79
+ "pda": {
80
+ "seeds": [
81
+ {
82
+ "kind": "const",
83
+ "value": [
84
+ 108,
85
+ 105,
86
+ 110,
87
+ 107
88
+ ]
89
+ },
90
+ {
91
+ "kind": "account",
92
+ "path": "link.id",
93
+ "account": "PaymentLink"
94
+ }
95
+ ]
96
+ }
97
+ },
98
+ {
99
+ "name": "authority",
100
+ "signer": true
101
+ }
102
+ ],
103
+ "args": []
104
+ },
105
+ {
106
+ "name": "create_link_sol",
107
+ "docs": [
108
+ "Create SOL payment link - ONLY merchant wallet owner can create"
109
+ ],
110
+ "discriminator": [
111
+ 46,
112
+ 180,
113
+ 191,
114
+ 160,
115
+ 51,
116
+ 59,
117
+ 155,
118
+ 130
119
+ ],
120
+ "accounts": [
121
+ {
122
+ "name": "protocol",
123
+ "writable": true,
124
+ "pda": {
125
+ "seeds": [
126
+ {
127
+ "kind": "const",
128
+ "value": [
129
+ 112,
130
+ 114,
131
+ 111,
132
+ 116,
133
+ 111,
134
+ 99,
135
+ 111,
136
+ 108
137
+ ]
138
+ }
139
+ ]
140
+ }
141
+ },
142
+ {
143
+ "name": "platform",
144
+ "pda": {
145
+ "seeds": [
146
+ {
147
+ "kind": "const",
148
+ "value": [
149
+ 112,
150
+ 108,
151
+ 97,
152
+ 116,
153
+ 102,
154
+ 111,
155
+ 114,
156
+ 109
157
+ ]
158
+ },
159
+ {
160
+ "kind": "account",
161
+ "path": "platform.id",
162
+ "account": "Platform"
163
+ }
164
+ ]
165
+ }
166
+ },
167
+ {
168
+ "name": "merchant",
169
+ "pda": {
170
+ "seeds": [
171
+ {
172
+ "kind": "const",
173
+ "value": [
174
+ 109,
175
+ 101,
176
+ 114,
177
+ 99,
178
+ 104,
179
+ 97,
180
+ 110,
181
+ 116
182
+ ]
183
+ },
184
+ {
185
+ "kind": "account",
186
+ "path": "merchant.id",
187
+ "account": "Merchant"
188
+ }
189
+ ]
190
+ }
191
+ },
192
+ {
193
+ "name": "link",
194
+ "writable": true
195
+ },
196
+ {
197
+ "name": "creator",
198
+ "writable": true,
199
+ "signer": true
200
+ },
201
+ {
202
+ "name": "system_program",
203
+ "address": "11111111111111111111111111111111"
204
+ }
205
+ ],
206
+ "args": [
207
+ {
208
+ "name": "amount",
209
+ "type": "u64"
210
+ },
211
+ {
212
+ "name": "expires_at",
213
+ "type": "i64"
214
+ },
215
+ {
216
+ "name": "allow_tips",
217
+ "type": "bool"
218
+ },
219
+ {
220
+ "name": "allow_partial",
221
+ "type": "bool"
222
+ },
223
+ {
224
+ "name": "order_ref",
225
+ "type": "u64"
226
+ }
227
+ ]
228
+ },
229
+ {
230
+ "name": "create_link_token",
231
+ "docs": [
232
+ "Create token payment link - ONLY merchant wallet owner can create"
233
+ ],
234
+ "discriminator": [
235
+ 106,
236
+ 234,
237
+ 111,
238
+ 192,
239
+ 219,
240
+ 106,
241
+ 205,
242
+ 229
243
+ ],
244
+ "accounts": [
245
+ {
246
+ "name": "protocol",
247
+ "writable": true,
248
+ "pda": {
249
+ "seeds": [
250
+ {
251
+ "kind": "const",
252
+ "value": [
253
+ 112,
254
+ 114,
255
+ 111,
256
+ 116,
257
+ 111,
258
+ 99,
259
+ 111,
260
+ 108
261
+ ]
262
+ }
263
+ ]
264
+ }
265
+ },
266
+ {
267
+ "name": "platform",
268
+ "pda": {
269
+ "seeds": [
270
+ {
271
+ "kind": "const",
272
+ "value": [
273
+ 112,
274
+ 108,
275
+ 97,
276
+ 116,
277
+ 102,
278
+ 111,
279
+ 114,
280
+ 109
281
+ ]
282
+ },
283
+ {
284
+ "kind": "account",
285
+ "path": "platform.id",
286
+ "account": "Platform"
287
+ }
288
+ ]
289
+ }
290
+ },
291
+ {
292
+ "name": "merchant",
293
+ "pda": {
294
+ "seeds": [
295
+ {
296
+ "kind": "const",
297
+ "value": [
298
+ 109,
299
+ 101,
300
+ 114,
301
+ 99,
302
+ 104,
303
+ 97,
304
+ 110,
305
+ 116
306
+ ]
307
+ },
308
+ {
309
+ "kind": "account",
310
+ "path": "merchant.id",
311
+ "account": "Merchant"
312
+ }
313
+ ]
314
+ }
315
+ },
316
+ {
317
+ "name": "link",
318
+ "writable": true
319
+ },
320
+ {
321
+ "name": "token_mint"
322
+ },
323
+ {
324
+ "name": "creator",
325
+ "writable": true,
326
+ "signer": true
327
+ },
328
+ {
329
+ "name": "system_program",
330
+ "address": "11111111111111111111111111111111"
331
+ }
332
+ ],
333
+ "args": [
334
+ {
335
+ "name": "amount",
336
+ "type": "u64"
337
+ },
338
+ {
339
+ "name": "expires_at",
340
+ "type": "i64"
341
+ },
342
+ {
343
+ "name": "allow_tips",
344
+ "type": "bool"
345
+ },
346
+ {
347
+ "name": "allow_partial",
348
+ "type": "bool"
349
+ },
350
+ {
351
+ "name": "order_ref",
352
+ "type": "u64"
353
+ }
354
+ ]
355
+ },
356
+ {
357
+ "name": "create_link_usd",
358
+ "docs": [
359
+ "Create a USD-denominated payment link - ONLY merchant wallet owner can create",
360
+ "Amount is in micro-USD (6 decimals, e.g., $10.00 = 10_000_000)"
361
+ ],
362
+ "discriminator": [
363
+ 200,
364
+ 160,
365
+ 178,
366
+ 240,
367
+ 36,
368
+ 158,
369
+ 175,
370
+ 74
371
+ ],
372
+ "accounts": [
373
+ {
374
+ "name": "protocol",
375
+ "writable": true,
376
+ "pda": {
377
+ "seeds": [
378
+ {
379
+ "kind": "const",
380
+ "value": [
381
+ 112,
382
+ 114,
383
+ 111,
384
+ 116,
385
+ 111,
386
+ 99,
387
+ 111,
388
+ 108
389
+ ]
390
+ }
391
+ ]
392
+ }
393
+ },
394
+ {
395
+ "name": "platform",
396
+ "pda": {
397
+ "seeds": [
398
+ {
399
+ "kind": "const",
400
+ "value": [
401
+ 112,
402
+ 108,
403
+ 97,
404
+ 116,
405
+ 102,
406
+ 111,
407
+ 114,
408
+ 109
409
+ ]
410
+ },
411
+ {
412
+ "kind": "account",
413
+ "path": "platform.id",
414
+ "account": "Platform"
415
+ }
416
+ ]
417
+ }
418
+ },
419
+ {
420
+ "name": "merchant",
421
+ "pda": {
422
+ "seeds": [
423
+ {
424
+ "kind": "const",
425
+ "value": [
426
+ 109,
427
+ 101,
428
+ 114,
429
+ 99,
430
+ 104,
431
+ 97,
432
+ 110,
433
+ 116
434
+ ]
435
+ },
436
+ {
437
+ "kind": "account",
438
+ "path": "merchant.id",
439
+ "account": "Merchant"
440
+ }
441
+ ]
442
+ }
443
+ },
444
+ {
445
+ "name": "link",
446
+ "writable": true
447
+ },
448
+ {
449
+ "name": "creator",
450
+ "writable": true,
451
+ "signer": true
452
+ },
453
+ {
454
+ "name": "system_program",
455
+ "address": "11111111111111111111111111111111"
456
+ }
457
+ ],
458
+ "args": [
459
+ {
460
+ "name": "amount",
461
+ "type": "u64"
462
+ },
463
+ {
464
+ "name": "expires_at",
465
+ "type": "i64"
466
+ },
467
+ {
468
+ "name": "allow_tips",
469
+ "type": "bool"
470
+ },
471
+ {
472
+ "name": "allow_partial",
473
+ "type": "bool"
474
+ },
475
+ {
476
+ "name": "order_ref",
477
+ "type": "u64"
478
+ }
479
+ ]
480
+ },
481
+ {
482
+ "name": "create_merchant",
483
+ "discriminator": [
484
+ 249,
485
+ 172,
486
+ 245,
487
+ 100,
488
+ 32,
489
+ 117,
490
+ 97,
491
+ 156
492
+ ],
493
+ "accounts": [
494
+ {
495
+ "name": "protocol",
496
+ "writable": true,
497
+ "pda": {
498
+ "seeds": [
499
+ {
500
+ "kind": "const",
501
+ "value": [
502
+ 112,
503
+ 114,
504
+ 111,
505
+ 116,
506
+ 111,
507
+ 99,
508
+ 111,
509
+ 108
510
+ ]
511
+ }
512
+ ]
513
+ }
514
+ },
515
+ {
516
+ "name": "platform",
517
+ "pda": {
518
+ "seeds": [
519
+ {
520
+ "kind": "const",
521
+ "value": [
522
+ 112,
523
+ 108,
524
+ 97,
525
+ 116,
526
+ 102,
527
+ 111,
528
+ 114,
529
+ 109
530
+ ]
531
+ },
532
+ {
533
+ "kind": "account",
534
+ "path": "platform.id",
535
+ "account": "Platform"
536
+ }
537
+ ]
538
+ }
539
+ },
540
+ {
541
+ "name": "merchant",
542
+ "writable": true
543
+ },
544
+ {
545
+ "name": "wallet"
546
+ },
547
+ {
548
+ "name": "payer",
549
+ "writable": true,
550
+ "signer": true
551
+ },
552
+ {
553
+ "name": "system_program",
554
+ "address": "11111111111111111111111111111111"
555
+ }
556
+ ],
557
+ "args": []
558
+ },
559
+ {
560
+ "name": "create_platform",
561
+ "discriminator": [
562
+ 159,
563
+ 106,
564
+ 44,
565
+ 241,
566
+ 53,
567
+ 188,
568
+ 123,
569
+ 238
570
+ ],
571
+ "accounts": [
572
+ {
573
+ "name": "protocol",
574
+ "writable": true,
575
+ "pda": {
576
+ "seeds": [
577
+ {
578
+ "kind": "const",
579
+ "value": [
580
+ 112,
581
+ 114,
582
+ 111,
583
+ 116,
584
+ 111,
585
+ 99,
586
+ 111,
587
+ 108
588
+ ]
589
+ }
590
+ ]
591
+ }
592
+ },
593
+ {
594
+ "name": "platform",
595
+ "writable": true
596
+ },
597
+ {
598
+ "name": "wallet"
599
+ },
600
+ {
601
+ "name": "admin",
602
+ "writable": true,
603
+ "signer": true
604
+ },
605
+ {
606
+ "name": "system_program",
607
+ "address": "11111111111111111111111111111111"
608
+ }
609
+ ],
610
+ "args": [
611
+ {
612
+ "name": "fee_bps",
613
+ "type": "u16"
614
+ }
615
+ ]
616
+ },
617
+ {
618
+ "name": "initialize",
619
+ "discriminator": [
620
+ 175,
621
+ 175,
622
+ 109,
623
+ 31,
624
+ 13,
625
+ 152,
626
+ 155,
627
+ 237
628
+ ],
629
+ "accounts": [
630
+ {
631
+ "name": "protocol",
632
+ "writable": true,
633
+ "pda": {
634
+ "seeds": [
635
+ {
636
+ "kind": "const",
637
+ "value": [
638
+ 112,
639
+ 114,
640
+ 111,
641
+ 116,
642
+ 111,
643
+ 99,
644
+ 111,
645
+ 108
646
+ ]
647
+ }
648
+ ]
649
+ }
650
+ },
651
+ {
652
+ "name": "treasury"
653
+ },
654
+ {
655
+ "name": "authority",
656
+ "writable": true,
657
+ "signer": true
658
+ },
659
+ {
660
+ "name": "system_program",
661
+ "address": "11111111111111111111111111111111"
662
+ }
663
+ ],
664
+ "args": [
665
+ {
666
+ "name": "usdc_mint",
667
+ "type": "pubkey"
668
+ },
669
+ {
670
+ "name": "usdt_mint",
671
+ "type": "pubkey"
672
+ }
673
+ ]
674
+ },
675
+ {
676
+ "name": "pay_link_sol",
677
+ "docs": [
678
+ "Pay link with SOL - fees are split 50/50 between buyer and seller"
679
+ ],
680
+ "discriminator": [
681
+ 218,
682
+ 181,
683
+ 250,
684
+ 77,
685
+ 128,
686
+ 119,
687
+ 108,
688
+ 48
689
+ ],
690
+ "accounts": [
691
+ {
692
+ "name": "protocol",
693
+ "pda": {
694
+ "seeds": [
695
+ {
696
+ "kind": "const",
697
+ "value": [
698
+ 112,
699
+ 114,
700
+ 111,
701
+ 116,
702
+ 111,
703
+ 99,
704
+ 111,
705
+ 108
706
+ ]
707
+ }
708
+ ]
709
+ }
710
+ },
711
+ {
712
+ "name": "platform",
713
+ "pda": {
714
+ "seeds": [
715
+ {
716
+ "kind": "const",
717
+ "value": [
718
+ 112,
719
+ 108,
720
+ 97,
721
+ 116,
722
+ 102,
723
+ 111,
724
+ 114,
725
+ 109
726
+ ]
727
+ },
728
+ {
729
+ "kind": "account",
730
+ "path": "platform.id",
731
+ "account": "Platform"
732
+ }
733
+ ]
734
+ }
735
+ },
736
+ {
737
+ "name": "merchant",
738
+ "pda": {
739
+ "seeds": [
740
+ {
741
+ "kind": "const",
742
+ "value": [
743
+ 109,
744
+ 101,
745
+ 114,
746
+ 99,
747
+ 104,
748
+ 97,
749
+ 110,
750
+ 116
751
+ ]
752
+ },
753
+ {
754
+ "kind": "account",
755
+ "path": "merchant.id",
756
+ "account": "Merchant"
757
+ }
758
+ ]
759
+ }
760
+ },
761
+ {
762
+ "name": "link",
763
+ "writable": true,
764
+ "pda": {
765
+ "seeds": [
766
+ {
767
+ "kind": "const",
768
+ "value": [
769
+ 108,
770
+ 105,
771
+ 110,
772
+ 107
773
+ ]
774
+ },
775
+ {
776
+ "kind": "account",
777
+ "path": "link.id",
778
+ "account": "PaymentLink"
779
+ }
780
+ ]
781
+ }
782
+ },
783
+ {
784
+ "name": "merchant_wallet",
785
+ "writable": true
786
+ },
787
+ {
788
+ "name": "platform_wallet",
789
+ "writable": true
790
+ },
791
+ {
792
+ "name": "treasury",
793
+ "writable": true
794
+ },
795
+ {
796
+ "name": "payer",
797
+ "writable": true,
798
+ "signer": true
799
+ },
800
+ {
801
+ "name": "system_program",
802
+ "address": "11111111111111111111111111111111"
803
+ }
804
+ ],
805
+ "args": [
806
+ {
807
+ "name": "amount",
808
+ "type": "u64"
809
+ },
810
+ {
811
+ "name": "tip",
812
+ "type": "u64"
813
+ }
814
+ ]
815
+ },
816
+ {
817
+ "name": "pay_link_token",
818
+ "docs": [
819
+ "Pay link with token - fees are split 50/50 between buyer and seller"
820
+ ],
821
+ "discriminator": [
822
+ 253,
823
+ 162,
824
+ 67,
825
+ 240,
826
+ 172,
827
+ 123,
828
+ 230,
829
+ 218
830
+ ],
831
+ "accounts": [
832
+ {
833
+ "name": "protocol",
834
+ "pda": {
835
+ "seeds": [
836
+ {
837
+ "kind": "const",
838
+ "value": [
839
+ 112,
840
+ 114,
841
+ 111,
842
+ 116,
843
+ 111,
844
+ 99,
845
+ 111,
846
+ 108
847
+ ]
848
+ }
849
+ ]
850
+ }
851
+ },
852
+ {
853
+ "name": "platform",
854
+ "pda": {
855
+ "seeds": [
856
+ {
857
+ "kind": "const",
858
+ "value": [
859
+ 112,
860
+ 108,
861
+ 97,
862
+ 116,
863
+ 102,
864
+ 111,
865
+ 114,
866
+ 109
867
+ ]
868
+ },
869
+ {
870
+ "kind": "account",
871
+ "path": "platform.id",
872
+ "account": "Platform"
873
+ }
874
+ ]
875
+ }
876
+ },
877
+ {
878
+ "name": "merchant",
879
+ "pda": {
880
+ "seeds": [
881
+ {
882
+ "kind": "const",
883
+ "value": [
884
+ 109,
885
+ 101,
886
+ 114,
887
+ 99,
888
+ 104,
889
+ 97,
890
+ 110,
891
+ 116
892
+ ]
893
+ },
894
+ {
895
+ "kind": "account",
896
+ "path": "merchant.id",
897
+ "account": "Merchant"
898
+ }
899
+ ]
900
+ }
901
+ },
902
+ {
903
+ "name": "link",
904
+ "writable": true,
905
+ "pda": {
906
+ "seeds": [
907
+ {
908
+ "kind": "const",
909
+ "value": [
910
+ 108,
911
+ 105,
912
+ 110,
913
+ 107
914
+ ]
915
+ },
916
+ {
917
+ "kind": "account",
918
+ "path": "link.id",
919
+ "account": "PaymentLink"
920
+ }
921
+ ]
922
+ }
923
+ },
924
+ {
925
+ "name": "payer_token_account",
926
+ "writable": true
927
+ },
928
+ {
929
+ "name": "merchant_token_account",
930
+ "writable": true
931
+ },
932
+ {
933
+ "name": "platform_token_account",
934
+ "writable": true
935
+ },
936
+ {
937
+ "name": "treasury_token_account",
938
+ "writable": true
939
+ },
940
+ {
941
+ "name": "payer",
942
+ "writable": true,
943
+ "signer": true
944
+ },
945
+ {
946
+ "name": "token_program",
947
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
948
+ }
949
+ ],
950
+ "args": [
951
+ {
952
+ "name": "amount",
953
+ "type": "u64"
954
+ },
955
+ {
956
+ "name": "tip",
957
+ "type": "u64"
958
+ }
959
+ ]
960
+ },
961
+ {
962
+ "name": "pay_link_usd_sol",
963
+ "docs": [
964
+ "Pay a USD-denominated link with SOL - fees split 50/50",
965
+ "Frontend converts USD to SOL and provides both values",
966
+ "usd_amount: micro-USD being paid (for tracking)",
967
+ "tip_usd: tip in micro-USD",
968
+ "lamports_amount: base lamports (before buyer's fee share is added)"
969
+ ],
970
+ "discriminator": [
971
+ 185,
972
+ 123,
973
+ 96,
974
+ 245,
975
+ 29,
976
+ 217,
977
+ 134,
978
+ 27
979
+ ],
980
+ "accounts": [
981
+ {
982
+ "name": "protocol",
983
+ "pda": {
984
+ "seeds": [
985
+ {
986
+ "kind": "const",
987
+ "value": [
988
+ 112,
989
+ 114,
990
+ 111,
991
+ 116,
992
+ 111,
993
+ 99,
994
+ 111,
995
+ 108
996
+ ]
997
+ }
998
+ ]
999
+ }
1000
+ },
1001
+ {
1002
+ "name": "platform",
1003
+ "pda": {
1004
+ "seeds": [
1005
+ {
1006
+ "kind": "const",
1007
+ "value": [
1008
+ 112,
1009
+ 108,
1010
+ 97,
1011
+ 116,
1012
+ 102,
1013
+ 111,
1014
+ 114,
1015
+ 109
1016
+ ]
1017
+ },
1018
+ {
1019
+ "kind": "account",
1020
+ "path": "platform.id",
1021
+ "account": "Platform"
1022
+ }
1023
+ ]
1024
+ }
1025
+ },
1026
+ {
1027
+ "name": "merchant",
1028
+ "pda": {
1029
+ "seeds": [
1030
+ {
1031
+ "kind": "const",
1032
+ "value": [
1033
+ 109,
1034
+ 101,
1035
+ 114,
1036
+ 99,
1037
+ 104,
1038
+ 97,
1039
+ 110,
1040
+ 116
1041
+ ]
1042
+ },
1043
+ {
1044
+ "kind": "account",
1045
+ "path": "merchant.id",
1046
+ "account": "Merchant"
1047
+ }
1048
+ ]
1049
+ }
1050
+ },
1051
+ {
1052
+ "name": "link",
1053
+ "writable": true,
1054
+ "pda": {
1055
+ "seeds": [
1056
+ {
1057
+ "kind": "const",
1058
+ "value": [
1059
+ 108,
1060
+ 105,
1061
+ 110,
1062
+ 107
1063
+ ]
1064
+ },
1065
+ {
1066
+ "kind": "account",
1067
+ "path": "link.id",
1068
+ "account": "PaymentLink"
1069
+ }
1070
+ ]
1071
+ }
1072
+ },
1073
+ {
1074
+ "name": "merchant_wallet",
1075
+ "writable": true
1076
+ },
1077
+ {
1078
+ "name": "platform_wallet",
1079
+ "writable": true
1080
+ },
1081
+ {
1082
+ "name": "treasury",
1083
+ "writable": true
1084
+ },
1085
+ {
1086
+ "name": "payer",
1087
+ "writable": true,
1088
+ "signer": true
1089
+ },
1090
+ {
1091
+ "name": "system_program",
1092
+ "address": "11111111111111111111111111111111"
1093
+ }
1094
+ ],
1095
+ "args": [
1096
+ {
1097
+ "name": "usd_amount",
1098
+ "type": "u64"
1099
+ },
1100
+ {
1101
+ "name": "tip_usd",
1102
+ "type": "u64"
1103
+ },
1104
+ {
1105
+ "name": "lamports_amount",
1106
+ "type": "u64"
1107
+ },
1108
+ {
1109
+ "name": "tip_lamports",
1110
+ "type": "u64"
1111
+ },
1112
+ {
1113
+ "name": "expected_lamports",
1114
+ "type": "u64"
1115
+ }
1116
+ ]
1117
+ },
1118
+ {
1119
+ "name": "close_link",
1120
+ "docs": [
1121
+ "Close a completed/cancelled link and reclaim rent SOL back to the merchant"
1122
+ ],
1123
+ "discriminator": [72, 219, 49, 233, 101, 46, 8, 189],
1124
+ "accounts": [
1125
+ {
1126
+ "name": "merchant",
1127
+ "pda": {
1128
+ "seeds": [
1129
+ {
1130
+ "kind": "const",
1131
+ "value": [109, 101, 114, 99, 104, 97, 110, 116]
1132
+ },
1133
+ {
1134
+ "kind": "account",
1135
+ "path": "merchant.id",
1136
+ "account": "Merchant"
1137
+ }
1138
+ ]
1139
+ }
1140
+ },
1141
+ {
1142
+ "name": "link",
1143
+ "writable": true,
1144
+ "pda": {
1145
+ "seeds": [
1146
+ {
1147
+ "kind": "const",
1148
+ "value": [108, 105, 110, 107]
1149
+ },
1150
+ {
1151
+ "kind": "account",
1152
+ "path": "link.id",
1153
+ "account": "PaymentLink"
1154
+ }
1155
+ ]
1156
+ }
1157
+ },
1158
+ {
1159
+ "name": "authority",
1160
+ "writable": true,
1161
+ "signer": true
1162
+ }
1163
+ ],
1164
+ "args": []
1165
+ },
1166
+ {
1167
+ "name": "update_protocol",
1168
+ "docs": [
1169
+ "Update protocol treasury address (authority only)"
1170
+ ],
1171
+ "discriminator": [194, 85, 167, 46, 55, 130, 3, 112],
1172
+ "accounts": [
1173
+ {
1174
+ "name": "protocol",
1175
+ "writable": true,
1176
+ "pda": {
1177
+ "seeds": [
1178
+ {
1179
+ "kind": "const",
1180
+ "value": [112, 114, 111, 116, 111, 99, 111, 108]
1181
+ }
1182
+ ]
1183
+ }
1184
+ },
1185
+ {
1186
+ "name": "new_treasury"
1187
+ },
1188
+ {
1189
+ "name": "authority",
1190
+ "signer": true
1191
+ }
1192
+ ],
1193
+ "args": []
1194
+ },
1195
+ {
1196
+ "name": "pay_link_usd_token",
1197
+ "docs": [
1198
+ "Pay a USD-denominated link with USDC or USDT - fees split 50/50",
1199
+ "Token amount = micro-USD (since USDC/USDT have 6 decimals and are 1:1 with USD)"
1200
+ ],
1201
+ "discriminator": [
1202
+ 206,
1203
+ 68,
1204
+ 161,
1205
+ 200,
1206
+ 28,
1207
+ 5,
1208
+ 139,
1209
+ 102
1210
+ ],
1211
+ "accounts": [
1212
+ {
1213
+ "name": "protocol",
1214
+ "pda": {
1215
+ "seeds": [
1216
+ {
1217
+ "kind": "const",
1218
+ "value": [
1219
+ 112,
1220
+ 114,
1221
+ 111,
1222
+ 116,
1223
+ 111,
1224
+ 99,
1225
+ 111,
1226
+ 108
1227
+ ]
1228
+ }
1229
+ ]
1230
+ }
1231
+ },
1232
+ {
1233
+ "name": "platform",
1234
+ "pda": {
1235
+ "seeds": [
1236
+ {
1237
+ "kind": "const",
1238
+ "value": [
1239
+ 112,
1240
+ 108,
1241
+ 97,
1242
+ 116,
1243
+ 102,
1244
+ 111,
1245
+ 114,
1246
+ 109
1247
+ ]
1248
+ },
1249
+ {
1250
+ "kind": "account",
1251
+ "path": "platform.id",
1252
+ "account": "Platform"
1253
+ }
1254
+ ]
1255
+ }
1256
+ },
1257
+ {
1258
+ "name": "merchant",
1259
+ "pda": {
1260
+ "seeds": [
1261
+ {
1262
+ "kind": "const",
1263
+ "value": [
1264
+ 109,
1265
+ 101,
1266
+ 114,
1267
+ 99,
1268
+ 104,
1269
+ 97,
1270
+ 110,
1271
+ 116
1272
+ ]
1273
+ },
1274
+ {
1275
+ "kind": "account",
1276
+ "path": "merchant.id",
1277
+ "account": "Merchant"
1278
+ }
1279
+ ]
1280
+ }
1281
+ },
1282
+ {
1283
+ "name": "link",
1284
+ "writable": true,
1285
+ "pda": {
1286
+ "seeds": [
1287
+ {
1288
+ "kind": "const",
1289
+ "value": [
1290
+ 108,
1291
+ 105,
1292
+ 110,
1293
+ 107
1294
+ ]
1295
+ },
1296
+ {
1297
+ "kind": "account",
1298
+ "path": "link.id",
1299
+ "account": "PaymentLink"
1300
+ }
1301
+ ]
1302
+ }
1303
+ },
1304
+ {
1305
+ "name": "payer_token_account",
1306
+ "writable": true
1307
+ },
1308
+ {
1309
+ "name": "merchant_token_account",
1310
+ "writable": true
1311
+ },
1312
+ {
1313
+ "name": "platform_token_account",
1314
+ "writable": true
1315
+ },
1316
+ {
1317
+ "name": "treasury_token_account",
1318
+ "writable": true
1319
+ },
1320
+ {
1321
+ "name": "payer",
1322
+ "writable": true,
1323
+ "signer": true
1324
+ },
1325
+ {
1326
+ "name": "token_program",
1327
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
1328
+ }
1329
+ ],
1330
+ "args": [
1331
+ {
1332
+ "name": "usd_amount",
1333
+ "type": "u64"
1334
+ },
1335
+ {
1336
+ "name": "tip_usd",
1337
+ "type": "u64"
1338
+ }
1339
+ ]
1340
+ },
1341
+ {
1342
+ "name": "pay_sol",
1343
+ "docs": [
1344
+ "Pay with SOL - fees are split 50/50 between buyer and seller",
1345
+ "`amount` is the base price, buyer pays amount + their half of fees",
1346
+ "",
1347
+ "P2P ARCHITECTURE: This instruction facilitates DIRECT transfers from the",
1348
+ "payer's wallet to the merchant, platform, and treasury wallets. The protocol",
1349
+ "NEVER holds or custodies funds - they flow directly wallet-to-wallet in a",
1350
+ "single atomic transaction signed by the payer."
1351
+ ],
1352
+ "discriminator": [
1353
+ 131,
1354
+ 101,
1355
+ 154,
1356
+ 50,
1357
+ 37,
1358
+ 136,
1359
+ 13,
1360
+ 67
1361
+ ],
1362
+ "accounts": [
1363
+ {
1364
+ "name": "protocol",
1365
+ "pda": {
1366
+ "seeds": [
1367
+ {
1368
+ "kind": "const",
1369
+ "value": [
1370
+ 112,
1371
+ 114,
1372
+ 111,
1373
+ 116,
1374
+ 111,
1375
+ 99,
1376
+ 111,
1377
+ 108
1378
+ ]
1379
+ }
1380
+ ]
1381
+ }
1382
+ },
1383
+ {
1384
+ "name": "platform",
1385
+ "pda": {
1386
+ "seeds": [
1387
+ {
1388
+ "kind": "const",
1389
+ "value": [
1390
+ 112,
1391
+ 108,
1392
+ 97,
1393
+ 116,
1394
+ 102,
1395
+ 111,
1396
+ 114,
1397
+ 109
1398
+ ]
1399
+ },
1400
+ {
1401
+ "kind": "account",
1402
+ "path": "platform.id",
1403
+ "account": "Platform"
1404
+ }
1405
+ ]
1406
+ }
1407
+ },
1408
+ {
1409
+ "name": "merchant",
1410
+ "pda": {
1411
+ "seeds": [
1412
+ {
1413
+ "kind": "const",
1414
+ "value": [
1415
+ 109,
1416
+ 101,
1417
+ 114,
1418
+ 99,
1419
+ 104,
1420
+ 97,
1421
+ 110,
1422
+ 116
1423
+ ]
1424
+ },
1425
+ {
1426
+ "kind": "account",
1427
+ "path": "merchant.id",
1428
+ "account": "Merchant"
1429
+ }
1430
+ ]
1431
+ }
1432
+ },
1433
+ {
1434
+ "name": "merchant_wallet",
1435
+ "writable": true
1436
+ },
1437
+ {
1438
+ "name": "platform_wallet",
1439
+ "writable": true
1440
+ },
1441
+ {
1442
+ "name": "treasury",
1443
+ "writable": true
1444
+ },
1445
+ {
1446
+ "name": "payer",
1447
+ "writable": true,
1448
+ "signer": true
1449
+ },
1450
+ {
1451
+ "name": "system_program",
1452
+ "address": "11111111111111111111111111111111"
1453
+ }
1454
+ ],
1455
+ "args": [
1456
+ {
1457
+ "name": "amount",
1458
+ "type": "u64"
1459
+ },
1460
+ {
1461
+ "name": "order_ref",
1462
+ "type": "u64"
1463
+ }
1464
+ ]
1465
+ },
1466
+ {
1467
+ "name": "pay_token",
1468
+ "docs": [
1469
+ "Pay with token (USDC/USDT) - fees are split 50/50 between buyer and seller",
1470
+ "`amount` is the base price, buyer pays amount + their half of fees"
1471
+ ],
1472
+ "discriminator": [
1473
+ 165,
1474
+ 233,
1475
+ 248,
1476
+ 250,
1477
+ 110,
1478
+ 155,
1479
+ 215,
1480
+ 142
1481
+ ],
1482
+ "accounts": [
1483
+ {
1484
+ "name": "protocol",
1485
+ "pda": {
1486
+ "seeds": [
1487
+ {
1488
+ "kind": "const",
1489
+ "value": [
1490
+ 112,
1491
+ 114,
1492
+ 111,
1493
+ 116,
1494
+ 111,
1495
+ 99,
1496
+ 111,
1497
+ 108
1498
+ ]
1499
+ }
1500
+ ]
1501
+ }
1502
+ },
1503
+ {
1504
+ "name": "platform",
1505
+ "pda": {
1506
+ "seeds": [
1507
+ {
1508
+ "kind": "const",
1509
+ "value": [
1510
+ 112,
1511
+ 108,
1512
+ 97,
1513
+ 116,
1514
+ 102,
1515
+ 111,
1516
+ 114,
1517
+ 109
1518
+ ]
1519
+ },
1520
+ {
1521
+ "kind": "account",
1522
+ "path": "platform.id",
1523
+ "account": "Platform"
1524
+ }
1525
+ ]
1526
+ }
1527
+ },
1528
+ {
1529
+ "name": "merchant",
1530
+ "pda": {
1531
+ "seeds": [
1532
+ {
1533
+ "kind": "const",
1534
+ "value": [
1535
+ 109,
1536
+ 101,
1537
+ 114,
1538
+ 99,
1539
+ 104,
1540
+ 97,
1541
+ 110,
1542
+ 116
1543
+ ]
1544
+ },
1545
+ {
1546
+ "kind": "account",
1547
+ "path": "merchant.id",
1548
+ "account": "Merchant"
1549
+ }
1550
+ ]
1551
+ }
1552
+ },
1553
+ {
1554
+ "name": "payer_token_account",
1555
+ "writable": true
1556
+ },
1557
+ {
1558
+ "name": "merchant_token_account",
1559
+ "writable": true
1560
+ },
1561
+ {
1562
+ "name": "platform_token_account",
1563
+ "writable": true
1564
+ },
1565
+ {
1566
+ "name": "treasury_token_account",
1567
+ "writable": true
1568
+ },
1569
+ {
1570
+ "name": "payer",
1571
+ "writable": true,
1572
+ "signer": true
1573
+ },
1574
+ {
1575
+ "name": "token_program",
1576
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
1577
+ }
1578
+ ],
1579
+ "args": [
1580
+ {
1581
+ "name": "amount",
1582
+ "type": "u64"
1583
+ },
1584
+ {
1585
+ "name": "order_ref",
1586
+ "type": "u64"
1587
+ }
1588
+ ]
1589
+ },
1590
+ {
1591
+ "name": "update_merchant",
1592
+ "docs": [
1593
+ "Update merchant - ONLY the merchant wallet owner can update their own account",
1594
+ "This ensures full decentralization - admins cannot modify merchant accounts"
1595
+ ],
1596
+ "discriminator": [
1597
+ 192,
1598
+ 114,
1599
+ 143,
1600
+ 220,
1601
+ 199,
1602
+ 50,
1603
+ 234,
1604
+ 165
1605
+ ],
1606
+ "accounts": [
1607
+ {
1608
+ "name": "merchant",
1609
+ "writable": true,
1610
+ "pda": {
1611
+ "seeds": [
1612
+ {
1613
+ "kind": "const",
1614
+ "value": [
1615
+ 109,
1616
+ 101,
1617
+ 114,
1618
+ 99,
1619
+ 104,
1620
+ 97,
1621
+ 110,
1622
+ 116
1623
+ ]
1624
+ },
1625
+ {
1626
+ "kind": "account",
1627
+ "path": "merchant.id",
1628
+ "account": "Merchant"
1629
+ }
1630
+ ]
1631
+ }
1632
+ },
1633
+ {
1634
+ "name": "platform",
1635
+ "pda": {
1636
+ "seeds": [
1637
+ {
1638
+ "kind": "const",
1639
+ "value": [
1640
+ 112,
1641
+ 108,
1642
+ 97,
1643
+ 116,
1644
+ 102,
1645
+ 111,
1646
+ 114,
1647
+ 109
1648
+ ]
1649
+ },
1650
+ {
1651
+ "kind": "account",
1652
+ "path": "merchant.platform_id",
1653
+ "account": "Merchant"
1654
+ }
1655
+ ]
1656
+ }
1657
+ },
1658
+ {
1659
+ "name": "new_wallet"
1660
+ },
1661
+ {
1662
+ "name": "authority",
1663
+ "signer": true
1664
+ }
1665
+ ],
1666
+ "args": [
1667
+ {
1668
+ "name": "active",
1669
+ "type": "bool"
1670
+ }
1671
+ ]
1672
+ },
1673
+ {
1674
+ "name": "update_platform",
1675
+ "discriminator": [
1676
+ 46,
1677
+ 78,
1678
+ 138,
1679
+ 189,
1680
+ 47,
1681
+ 163,
1682
+ 120,
1683
+ 85
1684
+ ],
1685
+ "accounts": [
1686
+ {
1687
+ "name": "platform",
1688
+ "writable": true,
1689
+ "pda": {
1690
+ "seeds": [
1691
+ {
1692
+ "kind": "const",
1693
+ "value": [
1694
+ 112,
1695
+ 108,
1696
+ 97,
1697
+ 116,
1698
+ 102,
1699
+ 111,
1700
+ 114,
1701
+ 109
1702
+ ]
1703
+ },
1704
+ {
1705
+ "kind": "account",
1706
+ "path": "platform.id",
1707
+ "account": "Platform"
1708
+ }
1709
+ ]
1710
+ }
1711
+ },
1712
+ {
1713
+ "name": "new_wallet"
1714
+ },
1715
+ {
1716
+ "name": "admin",
1717
+ "signer": true
1718
+ }
1719
+ ],
1720
+ "args": [
1721
+ {
1722
+ "name": "fee_bps",
1723
+ "type": "u16"
1724
+ },
1725
+ {
1726
+ "name": "active",
1727
+ "type": "bool"
1728
+ }
1729
+ ]
1730
+ }
1731
+ ],
1732
+ "accounts": [
1733
+ {
1734
+ "name": "Merchant",
1735
+ "discriminator": [
1736
+ 71,
1737
+ 235,
1738
+ 30,
1739
+ 40,
1740
+ 231,
1741
+ 21,
1742
+ 32,
1743
+ 64
1744
+ ]
1745
+ },
1746
+ {
1747
+ "name": "PaymentLink",
1748
+ "discriminator": [
1749
+ 169,
1750
+ 247,
1751
+ 147,
1752
+ 189,
1753
+ 39,
1754
+ 239,
1755
+ 14,
1756
+ 38
1757
+ ]
1758
+ },
1759
+ {
1760
+ "name": "Platform",
1761
+ "discriminator": [
1762
+ 77,
1763
+ 92,
1764
+ 204,
1765
+ 58,
1766
+ 187,
1767
+ 98,
1768
+ 91,
1769
+ 12
1770
+ ]
1771
+ },
1772
+ {
1773
+ "name": "Protocol",
1774
+ "discriminator": [
1775
+ 45,
1776
+ 39,
1777
+ 101,
1778
+ 43,
1779
+ 115,
1780
+ 72,
1781
+ 131,
1782
+ 40
1783
+ ]
1784
+ }
1785
+ ],
1786
+ "events": [
1787
+ {
1788
+ "name": "LinkCancelled",
1789
+ "discriminator": [
1790
+ 172,
1791
+ 145,
1792
+ 167,
1793
+ 209,
1794
+ 76,
1795
+ 111,
1796
+ 16,
1797
+ 243
1798
+ ]
1799
+ },
1800
+ {
1801
+ "name": "LinkClosed",
1802
+ "discriminator": [55, 202, 119, 47, 213, 72, 1, 189]
1803
+ },
1804
+ {
1805
+ "name": "ProtocolUpdated",
1806
+ "discriminator": [103, 44, 12, 198, 230, 110, 54, 81]
1807
+ },
1808
+ {
1809
+ "name": "LinkCreated",
1810
+ "discriminator": [
1811
+ 23,
1812
+ 29,
1813
+ 22,
1814
+ 108,
1815
+ 76,
1816
+ 67,
1817
+ 153,
1818
+ 254
1819
+ ]
1820
+ },
1821
+ {
1822
+ "name": "LinkCreatedUsd",
1823
+ "discriminator": [
1824
+ 81,
1825
+ 56,
1826
+ 12,
1827
+ 124,
1828
+ 206,
1829
+ 8,
1830
+ 144,
1831
+ 91
1832
+ ]
1833
+ },
1834
+ {
1835
+ "name": "LinkPaid",
1836
+ "discriminator": [
1837
+ 116,
1838
+ 1,
1839
+ 150,
1840
+ 15,
1841
+ 191,
1842
+ 215,
1843
+ 137,
1844
+ 228
1845
+ ]
1846
+ },
1847
+ {
1848
+ "name": "LinkPaidUsd",
1849
+ "discriminator": [
1850
+ 221,
1851
+ 153,
1852
+ 229,
1853
+ 29,
1854
+ 61,
1855
+ 153,
1856
+ 105,
1857
+ 230
1858
+ ]
1859
+ },
1860
+ {
1861
+ "name": "MerchantCreated",
1862
+ "discriminator": [
1863
+ 238,
1864
+ 186,
1865
+ 198,
1866
+ 159,
1867
+ 163,
1868
+ 130,
1869
+ 196,
1870
+ 86
1871
+ ]
1872
+ },
1873
+ {
1874
+ "name": "MerchantUpdated",
1875
+ "discriminator": [
1876
+ 45,
1877
+ 173,
1878
+ 249,
1879
+ 151,
1880
+ 20,
1881
+ 56,
1882
+ 193,
1883
+ 252
1884
+ ]
1885
+ },
1886
+ {
1887
+ "name": "PaymentProcessed",
1888
+ "discriminator": [
1889
+ 22,
1890
+ 109,
1891
+ 191,
1892
+ 213,
1893
+ 83,
1894
+ 63,
1895
+ 120,
1896
+ 219
1897
+ ]
1898
+ },
1899
+ {
1900
+ "name": "PlatformCreated",
1901
+ "discriminator": [
1902
+ 86,
1903
+ 177,
1904
+ 215,
1905
+ 146,
1906
+ 32,
1907
+ 39,
1908
+ 65,
1909
+ 103
1910
+ ]
1911
+ },
1912
+ {
1913
+ "name": "PlatformUpdated",
1914
+ "discriminator": [
1915
+ 75,
1916
+ 10,
1917
+ 83,
1918
+ 45,
1919
+ 92,
1920
+ 4,
1921
+ 133,
1922
+ 128
1923
+ ]
1924
+ },
1925
+ {
1926
+ "name": "ProtocolInitialized",
1927
+ "discriminator": [
1928
+ 173,
1929
+ 122,
1930
+ 168,
1931
+ 254,
1932
+ 9,
1933
+ 118,
1934
+ 76,
1935
+ 132
1936
+ ]
1937
+ }
1938
+ ],
1939
+ "errors": [
1940
+ {
1941
+ "code": 6000,
1942
+ "name": "FeeTooHigh",
1943
+ "msg": "Fee exceeds maximum (6%)"
1944
+ },
1945
+ {
1946
+ "code": 6001,
1947
+ "name": "PlatformNotActive",
1948
+ "msg": "Platform not active"
1949
+ },
1950
+ {
1951
+ "code": 6002,
1952
+ "name": "MerchantNotActive",
1953
+ "msg": "Merchant not active"
1954
+ },
1955
+ {
1956
+ "code": 6003,
1957
+ "name": "Unauthorized",
1958
+ "msg": "Unauthorized"
1959
+ },
1960
+ {
1961
+ "code": 6004,
1962
+ "name": "InvalidAmount",
1963
+ "msg": "Invalid amount"
1964
+ },
1965
+ {
1966
+ "code": 6005,
1967
+ "name": "AmountBelowMinimum",
1968
+ "msg": "Amount below minimum ($5)"
1969
+ },
1970
+ {
1971
+ "code": 6006,
1972
+ "name": "InvalidToken",
1973
+ "msg": "Invalid token"
1974
+ },
1975
+ {
1976
+ "code": 6007,
1977
+ "name": "DuplicateTokenMint",
1978
+ "msg": "Token mints must be different"
1979
+ },
1980
+ {
1981
+ "code": 6008,
1982
+ "name": "LinkNotPayable",
1983
+ "msg": "Link not payable"
1984
+ },
1985
+ {
1986
+ "code": 6009,
1987
+ "name": "LinkExpired",
1988
+ "msg": "Link expired"
1989
+ },
1990
+ {
1991
+ "code": 6010,
1992
+ "name": "ExpirationInPast",
1993
+ "msg": "Expiration must be in future"
1994
+ },
1995
+ {
1996
+ "code": 6011,
1997
+ "name": "TipsNotAllowed",
1998
+ "msg": "Tips not allowed"
1999
+ },
2000
+ {
2001
+ "code": 6012,
2002
+ "name": "TipTooLarge",
2003
+ "msg": "Tip exceeds maximum (100% of payment)"
2004
+ },
2005
+ {
2006
+ "code": 6013,
2007
+ "name": "PartialNotAllowed",
2008
+ "msg": "Partial payment not allowed"
2009
+ },
2010
+ {
2011
+ "code": 6014,
2012
+ "name": "PaymentExceedsRemaining",
2013
+ "msg": "Payment exceeds remaining"
2014
+ },
2015
+ {
2016
+ "code": 6015,
2017
+ "name": "Overflow",
2018
+ "msg": "Overflow"
2019
+ },
2020
+ {
2021
+ "code": 6016,
2022
+ "name": "InvalidWallet",
2023
+ "msg": "Invalid wallet"
2024
+ },
2025
+ {
2026
+ "code": 6017,
2027
+ "name": "PlatformMismatch",
2028
+ "msg": "Platform mismatch"
2029
+ },
2030
+ {
2031
+ "code": 6018,
2032
+ "name": "InvalidId",
2033
+ "msg": "Invalid ID (must be 7 digits: 1000000-9999999)"
2034
+ },
2035
+ {
2036
+ "code": 6019,
2037
+ "name": "LinkNotCloseable",
2038
+ "msg": "Link must be Paid or Cancelled to close"
2039
+ },
2040
+ {
2041
+ "code": 6020,
2042
+ "name": "PriceDeviationTooLarge",
2043
+ "msg": "SOL price deviation too large"
2044
+ }
2045
+ ],
2046
+ "types": [
2047
+ {
2048
+ "name": "LinkCancelled",
2049
+ "type": {
2050
+ "kind": "struct",
2051
+ "fields": [
2052
+ {
2053
+ "name": "id",
2054
+ "type": "u32"
2055
+ }
2056
+ ]
2057
+ }
2058
+ },
2059
+ {
2060
+ "name": "LinkClosed",
2061
+ "type": {
2062
+ "kind": "struct",
2063
+ "fields": [
2064
+ {
2065
+ "name": "id",
2066
+ "type": "u32"
2067
+ }
2068
+ ]
2069
+ }
2070
+ },
2071
+ {
2072
+ "name": "ProtocolUpdated",
2073
+ "type": {
2074
+ "kind": "struct",
2075
+ "fields": [
2076
+ {
2077
+ "name": "treasury",
2078
+ "type": "pubkey"
2079
+ }
2080
+ ]
2081
+ }
2082
+ },
2083
+ {
2084
+ "name": "LinkCreated",
2085
+ "type": {
2086
+ "kind": "struct",
2087
+ "fields": [
2088
+ {
2089
+ "name": "id",
2090
+ "type": "u32"
2091
+ },
2092
+ {
2093
+ "name": "merchant_id",
2094
+ "type": "u32"
2095
+ },
2096
+ {
2097
+ "name": "token_type",
2098
+ "type": {
2099
+ "defined": {
2100
+ "name": "TokenType"
2101
+ }
2102
+ }
2103
+ },
2104
+ {
2105
+ "name": "amount",
2106
+ "type": "u64"
2107
+ },
2108
+ {
2109
+ "name": "expires_at",
2110
+ "type": "i64"
2111
+ }
2112
+ ]
2113
+ }
2114
+ },
2115
+ {
2116
+ "name": "LinkCreatedUsd",
2117
+ "type": {
2118
+ "kind": "struct",
2119
+ "fields": [
2120
+ {
2121
+ "name": "id",
2122
+ "type": "u32"
2123
+ },
2124
+ {
2125
+ "name": "merchant_id",
2126
+ "type": "u32"
2127
+ },
2128
+ {
2129
+ "name": "amount_usd",
2130
+ "type": "u64"
2131
+ },
2132
+ {
2133
+ "name": "expires_at",
2134
+ "type": "i64"
2135
+ }
2136
+ ]
2137
+ }
2138
+ },
2139
+ {
2140
+ "name": "LinkPaid",
2141
+ "type": {
2142
+ "kind": "struct",
2143
+ "fields": [
2144
+ {
2145
+ "name": "id",
2146
+ "type": "u32"
2147
+ },
2148
+ {
2149
+ "name": "payer",
2150
+ "type": "pubkey"
2151
+ },
2152
+ {
2153
+ "name": "amount",
2154
+ "type": "u64"
2155
+ },
2156
+ {
2157
+ "name": "tip",
2158
+ "type": "u64"
2159
+ },
2160
+ {
2161
+ "name": "status",
2162
+ "type": {
2163
+ "defined": {
2164
+ "name": "LinkStatus"
2165
+ }
2166
+ }
2167
+ }
2168
+ ]
2169
+ }
2170
+ },
2171
+ {
2172
+ "name": "LinkPaidUsd",
2173
+ "type": {
2174
+ "kind": "struct",
2175
+ "fields": [
2176
+ {
2177
+ "name": "id",
2178
+ "type": "u32"
2179
+ },
2180
+ {
2181
+ "name": "payer",
2182
+ "type": "pubkey"
2183
+ },
2184
+ {
2185
+ "name": "usd_amount",
2186
+ "type": "u64"
2187
+ },
2188
+ {
2189
+ "name": "tip_usd",
2190
+ "type": "u64"
2191
+ },
2192
+ {
2193
+ "name": "status",
2194
+ "type": {
2195
+ "defined": {
2196
+ "name": "LinkStatus"
2197
+ }
2198
+ }
2199
+ },
2200
+ {
2201
+ "name": "token_type",
2202
+ "type": {
2203
+ "defined": {
2204
+ "name": "TokenType"
2205
+ }
2206
+ }
2207
+ }
2208
+ ]
2209
+ }
2210
+ },
2211
+ {
2212
+ "name": "LinkStatus",
2213
+ "type": {
2214
+ "kind": "enum",
2215
+ "variants": [
2216
+ {
2217
+ "name": "Pending"
2218
+ },
2219
+ {
2220
+ "name": "PartiallyPaid"
2221
+ },
2222
+ {
2223
+ "name": "Paid"
2224
+ },
2225
+ {
2226
+ "name": "Cancelled"
2227
+ }
2228
+ ]
2229
+ }
2230
+ },
2231
+ {
2232
+ "name": "Merchant",
2233
+ "type": {
2234
+ "kind": "struct",
2235
+ "fields": [
2236
+ {
2237
+ "name": "id",
2238
+ "type": "u32"
2239
+ },
2240
+ {
2241
+ "name": "platform_id",
2242
+ "type": "u32"
2243
+ },
2244
+ {
2245
+ "name": "wallet",
2246
+ "type": "pubkey"
2247
+ },
2248
+ {
2249
+ "name": "active",
2250
+ "type": "bool"
2251
+ },
2252
+ {
2253
+ "name": "bump",
2254
+ "type": "u8"
2255
+ }
2256
+ ]
2257
+ }
2258
+ },
2259
+ {
2260
+ "name": "MerchantCreated",
2261
+ "type": {
2262
+ "kind": "struct",
2263
+ "fields": [
2264
+ {
2265
+ "name": "id",
2266
+ "type": "u32"
2267
+ },
2268
+ {
2269
+ "name": "platform_id",
2270
+ "type": "u32"
2271
+ },
2272
+ {
2273
+ "name": "wallet",
2274
+ "type": "pubkey"
2275
+ }
2276
+ ]
2277
+ }
2278
+ },
2279
+ {
2280
+ "name": "MerchantUpdated",
2281
+ "type": {
2282
+ "kind": "struct",
2283
+ "fields": [
2284
+ {
2285
+ "name": "id",
2286
+ "type": "u32"
2287
+ },
2288
+ {
2289
+ "name": "wallet",
2290
+ "type": "pubkey"
2291
+ },
2292
+ {
2293
+ "name": "active",
2294
+ "type": "bool"
2295
+ }
2296
+ ]
2297
+ }
2298
+ },
2299
+ {
2300
+ "name": "PaymentLink",
2301
+ "type": {
2302
+ "kind": "struct",
2303
+ "fields": [
2304
+ {
2305
+ "name": "id",
2306
+ "type": "u32"
2307
+ },
2308
+ {
2309
+ "name": "merchant_id",
2310
+ "type": "u32"
2311
+ },
2312
+ {
2313
+ "name": "token_type",
2314
+ "type": {
2315
+ "defined": {
2316
+ "name": "TokenType"
2317
+ }
2318
+ }
2319
+ },
2320
+ {
2321
+ "name": "token_mint",
2322
+ "type": "pubkey"
2323
+ },
2324
+ {
2325
+ "name": "status",
2326
+ "type": {
2327
+ "defined": {
2328
+ "name": "LinkStatus"
2329
+ }
2330
+ }
2331
+ },
2332
+ {
2333
+ "name": "allow_tips",
2334
+ "type": "bool"
2335
+ },
2336
+ {
2337
+ "name": "allow_partial",
2338
+ "type": "bool"
2339
+ },
2340
+ {
2341
+ "name": "amount",
2342
+ "type": "u64"
2343
+ },
2344
+ {
2345
+ "name": "amount_paid",
2346
+ "type": "u64"
2347
+ },
2348
+ {
2349
+ "name": "expires_at",
2350
+ "type": "i64"
2351
+ },
2352
+ {
2353
+ "name": "order_ref",
2354
+ "type": "u64"
2355
+ },
2356
+ {
2357
+ "name": "bump",
2358
+ "type": "u8"
2359
+ }
2360
+ ]
2361
+ }
2362
+ },
2363
+ {
2364
+ "name": "PaymentProcessed",
2365
+ "type": {
2366
+ "kind": "struct",
2367
+ "fields": [
2368
+ {
2369
+ "name": "merchant_id",
2370
+ "type": "u32"
2371
+ },
2372
+ {
2373
+ "name": "payer",
2374
+ "type": "pubkey"
2375
+ },
2376
+ {
2377
+ "name": "amount",
2378
+ "type": "u64"
2379
+ },
2380
+ {
2381
+ "name": "protocol_fee",
2382
+ "type": "u64"
2383
+ },
2384
+ {
2385
+ "name": "platform_fee",
2386
+ "type": "u64"
2387
+ },
2388
+ {
2389
+ "name": "merchant_amount",
2390
+ "type": "u64"
2391
+ },
2392
+ {
2393
+ "name": "order_ref",
2394
+ "type": "u64"
2395
+ },
2396
+ {
2397
+ "name": "token_type",
2398
+ "type": {
2399
+ "defined": {
2400
+ "name": "TokenType"
2401
+ }
2402
+ }
2403
+ }
2404
+ ]
2405
+ }
2406
+ },
2407
+ {
2408
+ "name": "Platform",
2409
+ "type": {
2410
+ "kind": "struct",
2411
+ "fields": [
2412
+ {
2413
+ "name": "id",
2414
+ "type": "u32"
2415
+ },
2416
+ {
2417
+ "name": "admin",
2418
+ "type": "pubkey"
2419
+ },
2420
+ {
2421
+ "name": "wallet",
2422
+ "type": "pubkey"
2423
+ },
2424
+ {
2425
+ "name": "fee_bps",
2426
+ "type": "u16"
2427
+ },
2428
+ {
2429
+ "name": "active",
2430
+ "type": "bool"
2431
+ },
2432
+ {
2433
+ "name": "bump",
2434
+ "type": "u8"
2435
+ }
2436
+ ]
2437
+ }
2438
+ },
2439
+ {
2440
+ "name": "PlatformCreated",
2441
+ "type": {
2442
+ "kind": "struct",
2443
+ "fields": [
2444
+ {
2445
+ "name": "id",
2446
+ "type": "u32"
2447
+ },
2448
+ {
2449
+ "name": "admin",
2450
+ "type": "pubkey"
2451
+ },
2452
+ {
2453
+ "name": "wallet",
2454
+ "type": "pubkey"
2455
+ },
2456
+ {
2457
+ "name": "fee_bps",
2458
+ "type": "u16"
2459
+ }
2460
+ ]
2461
+ }
2462
+ },
2463
+ {
2464
+ "name": "PlatformUpdated",
2465
+ "type": {
2466
+ "kind": "struct",
2467
+ "fields": [
2468
+ {
2469
+ "name": "id",
2470
+ "type": "u32"
2471
+ },
2472
+ {
2473
+ "name": "fee_bps",
2474
+ "type": "u16"
2475
+ },
2476
+ {
2477
+ "name": "wallet",
2478
+ "type": "pubkey"
2479
+ },
2480
+ {
2481
+ "name": "active",
2482
+ "type": "bool"
2483
+ }
2484
+ ]
2485
+ }
2486
+ },
2487
+ {
2488
+ "name": "Protocol",
2489
+ "type": {
2490
+ "kind": "struct",
2491
+ "fields": [
2492
+ {
2493
+ "name": "authority",
2494
+ "type": "pubkey"
2495
+ },
2496
+ {
2497
+ "name": "treasury",
2498
+ "type": "pubkey"
2499
+ },
2500
+ {
2501
+ "name": "usdc_mint",
2502
+ "type": "pubkey"
2503
+ },
2504
+ {
2505
+ "name": "usdt_mint",
2506
+ "type": "pubkey"
2507
+ },
2508
+ {
2509
+ "name": "platform_count",
2510
+ "type": "u32"
2511
+ },
2512
+ {
2513
+ "name": "merchant_count",
2514
+ "type": "u32"
2515
+ },
2516
+ {
2517
+ "name": "link_count",
2518
+ "type": "u32"
2519
+ },
2520
+ {
2521
+ "name": "bump",
2522
+ "type": "u8"
2523
+ }
2524
+ ]
2525
+ }
2526
+ },
2527
+ {
2528
+ "name": "ProtocolInitialized",
2529
+ "type": {
2530
+ "kind": "struct",
2531
+ "fields": [
2532
+ {
2533
+ "name": "authority",
2534
+ "type": "pubkey"
2535
+ },
2536
+ {
2537
+ "name": "treasury",
2538
+ "type": "pubkey"
2539
+ },
2540
+ {
2541
+ "name": "usdc_mint",
2542
+ "type": "pubkey"
2543
+ },
2544
+ {
2545
+ "name": "usdt_mint",
2546
+ "type": "pubkey"
2547
+ }
2548
+ ]
2549
+ }
2550
+ },
2551
+ {
2552
+ "name": "TokenType",
2553
+ "type": {
2554
+ "kind": "enum",
2555
+ "variants": [
2556
+ {
2557
+ "name": "Sol"
2558
+ },
2559
+ {
2560
+ "name": "Usdc"
2561
+ },
2562
+ {
2563
+ "name": "Usdt"
2564
+ },
2565
+ {
2566
+ "name": "Usd"
2567
+ }
2568
+ ]
2569
+ }
2570
+ }
2571
+ ]
2572
+ }