@atomiqlabs/chain-solana 13.5.13 → 13.5.14

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 (131) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +73 -73
  3. package/dist/index.d.ts +81 -81
  4. package/dist/index.js +102 -102
  5. package/dist/node/index.d.ts +9 -9
  6. package/dist/node/index.js +13 -13
  7. package/dist/solana/SolanaChainType.d.ts +15 -15
  8. package/dist/solana/SolanaChainType.js +2 -2
  9. package/dist/solana/SolanaChains.d.ts +12 -12
  10. package/dist/solana/SolanaChains.js +45 -45
  11. package/dist/solana/SolanaInitializer.d.ts +94 -94
  12. package/dist/solana/SolanaInitializer.js +174 -174
  13. package/dist/solana/btcrelay/SolanaBtcRelay.d.ts +222 -222
  14. package/dist/solana/btcrelay/SolanaBtcRelay.js +455 -455
  15. package/dist/solana/btcrelay/headers/SolanaBtcHeader.d.ts +84 -84
  16. package/dist/solana/btcrelay/headers/SolanaBtcHeader.js +70 -70
  17. package/dist/solana/btcrelay/headers/SolanaBtcStoredHeader.d.ts +92 -92
  18. package/dist/solana/btcrelay/headers/SolanaBtcStoredHeader.js +109 -109
  19. package/dist/solana/btcrelay/program/programIdl.json +671 -671
  20. package/dist/solana/chain/SolanaAction.d.ts +26 -26
  21. package/dist/solana/chain/SolanaAction.js +87 -87
  22. package/dist/solana/chain/SolanaChainInterface.d.ts +224 -224
  23. package/dist/solana/chain/SolanaChainInterface.js +275 -275
  24. package/dist/solana/chain/SolanaModule.d.ts +14 -14
  25. package/dist/solana/chain/SolanaModule.js +13 -13
  26. package/dist/solana/chain/modules/SolanaAddresses.d.ts +8 -8
  27. package/dist/solana/chain/modules/SolanaAddresses.js +22 -22
  28. package/dist/solana/chain/modules/SolanaBlocks.d.ts +32 -32
  29. package/dist/solana/chain/modules/SolanaBlocks.js +78 -78
  30. package/dist/solana/chain/modules/SolanaEvents.d.ts +68 -68
  31. package/dist/solana/chain/modules/SolanaEvents.js +238 -238
  32. package/dist/solana/chain/modules/SolanaFees.d.ts +189 -189
  33. package/dist/solana/chain/modules/SolanaFees.js +434 -434
  34. package/dist/solana/chain/modules/SolanaSignatures.d.ts +24 -24
  35. package/dist/solana/chain/modules/SolanaSignatures.js +39 -39
  36. package/dist/solana/chain/modules/SolanaSlots.d.ts +33 -33
  37. package/dist/solana/chain/modules/SolanaSlots.js +72 -72
  38. package/dist/solana/chain/modules/SolanaTokens.d.ts +123 -123
  39. package/dist/solana/chain/modules/SolanaTokens.js +242 -242
  40. package/dist/solana/chain/modules/SolanaTransactions.d.ts +149 -149
  41. package/dist/solana/chain/modules/SolanaTransactions.js +445 -445
  42. package/dist/solana/connection/ConnectionWithRetries.d.ts +35 -35
  43. package/dist/solana/connection/ConnectionWithRetries.js +86 -71
  44. package/dist/solana/events/SolanaChainEvents.d.ts +45 -45
  45. package/dist/solana/events/SolanaChainEvents.js +108 -108
  46. package/dist/solana/events/SolanaChainEventsBrowser.d.ts +205 -205
  47. package/dist/solana/events/SolanaChainEventsBrowser.js +404 -404
  48. package/dist/solana/program/SolanaProgramBase.d.ts +73 -73
  49. package/dist/solana/program/SolanaProgramBase.js +54 -54
  50. package/dist/solana/program/SolanaProgramModule.d.ts +8 -8
  51. package/dist/solana/program/SolanaProgramModule.js +11 -11
  52. package/dist/solana/program/modules/SolanaProgramEvents.d.ts +53 -53
  53. package/dist/solana/program/modules/SolanaProgramEvents.js +117 -117
  54. package/dist/solana/swaps/SolanaSwapData.d.ts +333 -333
  55. package/dist/solana/swaps/SolanaSwapData.js +535 -535
  56. package/dist/solana/swaps/SolanaSwapModule.d.ts +11 -11
  57. package/dist/solana/swaps/SolanaSwapModule.js +12 -12
  58. package/dist/solana/swaps/SolanaSwapProgram.d.ts +376 -376
  59. package/dist/solana/swaps/SolanaSwapProgram.js +769 -769
  60. package/dist/solana/swaps/SwapTypeEnum.d.ts +11 -11
  61. package/dist/solana/swaps/SwapTypeEnum.js +43 -43
  62. package/dist/solana/swaps/modules/SolanaDataAccount.d.ts +95 -95
  63. package/dist/solana/swaps/modules/SolanaDataAccount.js +232 -232
  64. package/dist/solana/swaps/modules/SolanaLpVault.d.ts +69 -69
  65. package/dist/solana/swaps/modules/SolanaLpVault.js +171 -171
  66. package/dist/solana/swaps/modules/SwapClaim.d.ts +126 -126
  67. package/dist/solana/swaps/modules/SwapClaim.js +294 -294
  68. package/dist/solana/swaps/modules/SwapInit.d.ts +213 -213
  69. package/dist/solana/swaps/modules/SwapInit.js +658 -658
  70. package/dist/solana/swaps/modules/SwapRefund.d.ts +87 -87
  71. package/dist/solana/swaps/modules/SwapRefund.js +293 -293
  72. package/dist/solana/swaps/programIdl.json +945 -945
  73. package/dist/solana/swaps/programTypes.d.ts +943 -943
  74. package/dist/solana/swaps/programTypes.js +945 -945
  75. package/dist/solana/swaps/v1/programIdl.json +945 -945
  76. package/dist/solana/swaps/v1/programTypes.d.ts +943 -943
  77. package/dist/solana/swaps/v1/programTypes.js +945 -945
  78. package/dist/solana/swaps/v2/programIdl.json +952 -952
  79. package/dist/solana/swaps/v2/programTypes.d.ts +950 -950
  80. package/dist/solana/swaps/v2/programTypes.js +952 -952
  81. package/dist/solana/wallet/SolanaKeypairWallet.d.ts +29 -29
  82. package/dist/solana/wallet/SolanaKeypairWallet.js +50 -50
  83. package/dist/solana/wallet/SolanaSigner.d.ts +30 -30
  84. package/dist/solana/wallet/SolanaSigner.js +30 -30
  85. package/dist/utils/Utils.d.ts +58 -58
  86. package/dist/utils/Utils.js +170 -170
  87. package/node/index.d.ts +1 -1
  88. package/node/index.js +3 -3
  89. package/package.json +46 -46
  90. package/src/index.ts +87 -87
  91. package/src/node/index.ts +9 -9
  92. package/src/solana/SolanaChainType.ts +32 -32
  93. package/src/solana/SolanaChains.ts +46 -46
  94. package/src/solana/SolanaInitializer.ts +278 -278
  95. package/src/solana/btcrelay/SolanaBtcRelay.ts +615 -615
  96. package/src/solana/btcrelay/headers/SolanaBtcHeader.ts +116 -116
  97. package/src/solana/btcrelay/headers/SolanaBtcStoredHeader.ts +148 -148
  98. package/src/solana/btcrelay/program/programIdl.json +670 -670
  99. package/src/solana/chain/SolanaAction.ts +109 -109
  100. package/src/solana/chain/SolanaChainInterface.ts +404 -404
  101. package/src/solana/chain/SolanaModule.ts +20 -20
  102. package/src/solana/chain/modules/SolanaAddresses.ts +20 -20
  103. package/src/solana/chain/modules/SolanaBlocks.ts +89 -89
  104. package/src/solana/chain/modules/SolanaEvents.ts +271 -271
  105. package/src/solana/chain/modules/SolanaFees.ts +522 -522
  106. package/src/solana/chain/modules/SolanaSignatures.ts +39 -39
  107. package/src/solana/chain/modules/SolanaSlots.ts +85 -85
  108. package/src/solana/chain/modules/SolanaTokens.ts +300 -300
  109. package/src/solana/chain/modules/SolanaTransactions.ts +503 -503
  110. package/src/solana/connection/ConnectionWithRetries.ts +113 -96
  111. package/src/solana/events/SolanaChainEvents.ts +127 -127
  112. package/src/solana/events/SolanaChainEventsBrowser.ts +495 -495
  113. package/src/solana/program/SolanaProgramBase.ts +119 -119
  114. package/src/solana/program/SolanaProgramModule.ts +15 -15
  115. package/src/solana/program/modules/SolanaProgramEvents.ts +157 -157
  116. package/src/solana/swaps/SolanaSwapData.ts +735 -735
  117. package/src/solana/swaps/SolanaSwapModule.ts +19 -19
  118. package/src/solana/swaps/SolanaSwapProgram.ts +1074 -1074
  119. package/src/solana/swaps/SwapTypeEnum.ts +30 -30
  120. package/src/solana/swaps/modules/SolanaDataAccount.ts +302 -302
  121. package/src/solana/swaps/modules/SolanaLpVault.ts +208 -208
  122. package/src/solana/swaps/modules/SwapClaim.ts +387 -387
  123. package/src/solana/swaps/modules/SwapInit.ts +785 -785
  124. package/src/solana/swaps/modules/SwapRefund.ts +353 -353
  125. package/src/solana/swaps/v1/programIdl.json +944 -944
  126. package/src/solana/swaps/v1/programTypes.ts +1885 -1885
  127. package/src/solana/swaps/v2/programIdl.json +951 -951
  128. package/src/solana/swaps/v2/programTypes.ts +1899 -1899
  129. package/src/solana/wallet/SolanaKeypairWallet.ts +56 -56
  130. package/src/solana/wallet/SolanaSigner.ts +43 -43
  131. package/src/utils/Utils.ts +194 -194
@@ -1,1899 +1,1899 @@
1
- export type SwapProgramV2 = {
2
- "version": "0.2.0",
3
- "name": "swap_program",
4
- "instructions": [
5
- {
6
- "name": "deposit",
7
- "accounts": [
8
- {
9
- "name": "signer",
10
- "isMut": true,
11
- "isSigner": true
12
- },
13
- {
14
- "name": "signerAta",
15
- "isMut": true,
16
- "isSigner": false
17
- },
18
- {
19
- "name": "userData",
20
- "isMut": true,
21
- "isSigner": false
22
- },
23
- {
24
- "name": "vault",
25
- "isMut": true,
26
- "isSigner": false
27
- },
28
- {
29
- "name": "mint",
30
- "isMut": false,
31
- "isSigner": false
32
- },
33
- {
34
- "name": "systemProgram",
35
- "isMut": false,
36
- "isSigner": false
37
- },
38
- {
39
- "name": "tokenProgram",
40
- "isMut": false,
41
- "isSigner": false
42
- }
43
- ],
44
- "args": [
45
- {
46
- "name": "amount",
47
- "type": "u64"
48
- }
49
- ]
50
- },
51
- {
52
- "name": "withdraw",
53
- "accounts": [
54
- {
55
- "name": "signer",
56
- "isMut": true,
57
- "isSigner": true
58
- },
59
- {
60
- "name": "signerAta",
61
- "isMut": true,
62
- "isSigner": false
63
- },
64
- {
65
- "name": "userData",
66
- "isMut": true,
67
- "isSigner": false
68
- },
69
- {
70
- "name": "vault",
71
- "isMut": true,
72
- "isSigner": false
73
- },
74
- {
75
- "name": "mint",
76
- "isMut": false,
77
- "isSigner": false
78
- },
79
- {
80
- "name": "tokenProgram",
81
- "isMut": false,
82
- "isSigner": false
83
- }
84
- ],
85
- "args": [
86
- {
87
- "name": "amount",
88
- "type": "u64"
89
- }
90
- ]
91
- },
92
- {
93
- "name": "offererInitializePayIn",
94
- "accounts": [
95
- {
96
- "name": "offerer",
97
- "isMut": false,
98
- "isSigner": true
99
- },
100
- {
101
- "name": "claimer",
102
- "isMut": false,
103
- "isSigner": false
104
- },
105
- {
106
- "name": "initializer",
107
- "isMut": true,
108
- "isSigner": true
109
- },
110
- {
111
- "name": "offererAta",
112
- "isMut": true,
113
- "isSigner": false
114
- },
115
- {
116
- "name": "escrowState",
117
- "isMut": true,
118
- "isSigner": false
119
- },
120
- {
121
- "name": "vault",
122
- "isMut": true,
123
- "isSigner": false
124
- },
125
- {
126
- "name": "mint",
127
- "isMut": false,
128
- "isSigner": false
129
- },
130
- {
131
- "name": "systemProgram",
132
- "isMut": false,
133
- "isSigner": false
134
- },
135
- {
136
- "name": "tokenProgram",
137
- "isMut": false,
138
- "isSigner": false
139
- },
140
- {
141
- "name": "claimerUserData",
142
- "isMut": false,
143
- "isSigner": false,
144
- "isOptional": true
145
- },
146
- {
147
- "name": "claimerAta",
148
- "isMut": false,
149
- "isSigner": false,
150
- "isOptional": true
151
- }
152
- ],
153
- "args": [
154
- {
155
- "name": "swapData",
156
- "type": {
157
- "defined": "SwapData"
158
- }
159
- },
160
- {
161
- "name": "securityDeposit",
162
- "type": "u64"
163
- },
164
- {
165
- "name": "claimerBounty",
166
- "type": "u64"
167
- },
168
- {
169
- "name": "txoHash",
170
- "type": {
171
- "array": [
172
- "u8",
173
- 32
174
- ]
175
- }
176
- },
177
- {
178
- "name": "authExpiry",
179
- "type": "u64"
180
- }
181
- ]
182
- },
183
- {
184
- "name": "offererInitialize",
185
- "accounts": [
186
- {
187
- "name": "offerer",
188
- "isMut": false,
189
- "isSigner": true
190
- },
191
- {
192
- "name": "claimer",
193
- "isMut": false,
194
- "isSigner": false
195
- },
196
- {
197
- "name": "initializer",
198
- "isMut": true,
199
- "isSigner": true
200
- },
201
- {
202
- "name": "offererUserData",
203
- "isMut": true,
204
- "isSigner": false
205
- },
206
- {
207
- "name": "escrowState",
208
- "isMut": true,
209
- "isSigner": false
210
- },
211
- {
212
- "name": "mint",
213
- "isMut": false,
214
- "isSigner": false
215
- },
216
- {
217
- "name": "systemProgram",
218
- "isMut": false,
219
- "isSigner": false
220
- },
221
- {
222
- "name": "claimerUserData",
223
- "isMut": false,
224
- "isSigner": false,
225
- "isOptional": true
226
- },
227
- {
228
- "name": "claimerAta",
229
- "isMut": false,
230
- "isSigner": false,
231
- "isOptional": true
232
- }
233
- ],
234
- "args": [
235
- {
236
- "name": "swapData",
237
- "type": {
238
- "defined": "SwapData"
239
- }
240
- },
241
- {
242
- "name": "securityDeposit",
243
- "type": "u64"
244
- },
245
- {
246
- "name": "claimerBounty",
247
- "type": "u64"
248
- },
249
- {
250
- "name": "txoHash",
251
- "type": {
252
- "array": [
253
- "u8",
254
- 32
255
- ]
256
- }
257
- },
258
- {
259
- "name": "authExpiry",
260
- "type": "u64"
261
- }
262
- ]
263
- },
264
- {
265
- "name": "offererRefund",
266
- "accounts": [
267
- {
268
- "name": "offerer",
269
- "isMut": true,
270
- "isSigner": false
271
- },
272
- {
273
- "name": "claimer",
274
- "isMut": true,
275
- "isSigner": false
276
- },
277
- {
278
- "name": "escrowState",
279
- "isMut": true,
280
- "isSigner": false
281
- },
282
- {
283
- "name": "offererUserData",
284
- "isMut": true,
285
- "isSigner": false
286
- },
287
- {
288
- "name": "claimerUserData",
289
- "isMut": true,
290
- "isSigner": false,
291
- "isOptional": true
292
- },
293
- {
294
- "name": "ixSysvar",
295
- "isMut": false,
296
- "isSigner": false,
297
- "isOptional": true
298
- }
299
- ],
300
- "args": [
301
- {
302
- "name": "authExpiry",
303
- "type": "u64"
304
- }
305
- ]
306
- },
307
- {
308
- "name": "offererRefundPayIn",
309
- "accounts": [
310
- {
311
- "name": "offerer",
312
- "isMut": true,
313
- "isSigner": false
314
- },
315
- {
316
- "name": "claimer",
317
- "isMut": true,
318
- "isSigner": false
319
- },
320
- {
321
- "name": "offererAta",
322
- "isMut": true,
323
- "isSigner": false
324
- },
325
- {
326
- "name": "escrowState",
327
- "isMut": true,
328
- "isSigner": false
329
- },
330
- {
331
- "name": "vault",
332
- "isMut": true,
333
- "isSigner": false
334
- },
335
- {
336
- "name": "tokenProgram",
337
- "isMut": false,
338
- "isSigner": false
339
- },
340
- {
341
- "name": "claimerUserData",
342
- "isMut": true,
343
- "isSigner": false,
344
- "isOptional": true
345
- },
346
- {
347
- "name": "ixSysvar",
348
- "isMut": false,
349
- "isSigner": false,
350
- "isOptional": true
351
- }
352
- ],
353
- "args": [
354
- {
355
- "name": "authExpiry",
356
- "type": "u64"
357
- }
358
- ]
359
- },
360
- {
361
- "name": "claimerClaim",
362
- "accounts": [
363
- {
364
- "name": "signer",
365
- "isMut": true,
366
- "isSigner": true
367
- },
368
- {
369
- "name": "offerer",
370
- "isMut": true,
371
- "isSigner": false
372
- },
373
- {
374
- "name": "claimer",
375
- "isMut": true,
376
- "isSigner": false
377
- },
378
- {
379
- "name": "escrowState",
380
- "isMut": true,
381
- "isSigner": false
382
- },
383
- {
384
- "name": "ixSysvar",
385
- "isMut": false,
386
- "isSigner": false
387
- },
388
- {
389
- "name": "claimerUserData",
390
- "isMut": true,
391
- "isSigner": false
392
- },
393
- {
394
- "name": "data",
395
- "isMut": true,
396
- "isSigner": false,
397
- "isOptional": true
398
- }
399
- ],
400
- "args": [
401
- {
402
- "name": "secret",
403
- "type": "bytes"
404
- }
405
- ]
406
- },
407
- {
408
- "name": "claimerClaimPayOut",
409
- "accounts": [
410
- {
411
- "name": "signer",
412
- "isMut": true,
413
- "isSigner": true
414
- },
415
- {
416
- "name": "offerer",
417
- "isMut": true,
418
- "isSigner": false
419
- },
420
- {
421
- "name": "claimer",
422
- "isMut": true,
423
- "isSigner": false
424
- },
425
- {
426
- "name": "escrowState",
427
- "isMut": true,
428
- "isSigner": false
429
- },
430
- {
431
- "name": "ixSysvar",
432
- "isMut": false,
433
- "isSigner": false
434
- },
435
- {
436
- "name": "claimerAta",
437
- "isMut": true,
438
- "isSigner": false
439
- },
440
- {
441
- "name": "vault",
442
- "isMut": true,
443
- "isSigner": false
444
- },
445
- {
446
- "name": "tokenProgram",
447
- "isMut": false,
448
- "isSigner": false
449
- },
450
- {
451
- "name": "data",
452
- "isMut": true,
453
- "isSigner": false,
454
- "isOptional": true
455
- }
456
- ],
457
- "args": [
458
- {
459
- "name": "secret",
460
- "type": "bytes"
461
- }
462
- ]
463
- },
464
- {
465
- "name": "initData",
466
- "accounts": [
467
- {
468
- "name": "signer",
469
- "isMut": true,
470
- "isSigner": true
471
- },
472
- {
473
- "name": "data",
474
- "isMut": true,
475
- "isSigner": true
476
- }
477
- ],
478
- "args": []
479
- },
480
- {
481
- "name": "writeData",
482
- "accounts": [
483
- {
484
- "name": "signer",
485
- "isMut": true,
486
- "isSigner": true
487
- },
488
- {
489
- "name": "data",
490
- "isMut": true,
491
- "isSigner": false
492
- }
493
- ],
494
- "args": [
495
- {
496
- "name": "start",
497
- "type": "u32"
498
- },
499
- {
500
- "name": "data",
501
- "type": "bytes"
502
- }
503
- ]
504
- },
505
- {
506
- "name": "closeData",
507
- "accounts": [
508
- {
509
- "name": "signer",
510
- "isMut": true,
511
- "isSigner": true
512
- },
513
- {
514
- "name": "data",
515
- "isMut": true,
516
- "isSigner": false
517
- }
518
- ],
519
- "args": []
520
- }
521
- ],
522
- "accounts": [
523
- {
524
- "name": "escrowState",
525
- "type": {
526
- "kind": "struct",
527
- "fields": [
528
- {
529
- "name": "data",
530
- "type": {
531
- "defined": "SwapData"
532
- }
533
- },
534
- {
535
- "name": "offerer",
536
- "type": "publicKey"
537
- },
538
- {
539
- "name": "offererAta",
540
- "type": "publicKey"
541
- },
542
- {
543
- "name": "claimer",
544
- "type": "publicKey"
545
- },
546
- {
547
- "name": "claimerAta",
548
- "type": "publicKey"
549
- },
550
- {
551
- "name": "mint",
552
- "type": "publicKey"
553
- },
554
- {
555
- "name": "claimerBounty",
556
- "type": "u64"
557
- },
558
- {
559
- "name": "securityDeposit",
560
- "type": "u64"
561
- },
562
- {
563
- "name": "offererInitializer",
564
- "type": "bool"
565
- }
566
- ]
567
- }
568
- },
569
- {
570
- "name": "userAccount",
571
- "type": {
572
- "kind": "struct",
573
- "fields": [
574
- {
575
- "name": "amount",
576
- "type": "u64"
577
- },
578
- {
579
- "name": "successVolume",
580
- "type": {
581
- "array": [
582
- "u64",
583
- 4
584
- ]
585
- }
586
- },
587
- {
588
- "name": "successCount",
589
- "type": {
590
- "array": [
591
- "u64",
592
- 4
593
- ]
594
- }
595
- },
596
- {
597
- "name": "failVolume",
598
- "type": {
599
- "array": [
600
- "u64",
601
- 4
602
- ]
603
- }
604
- },
605
- {
606
- "name": "failCount",
607
- "type": {
608
- "array": [
609
- "u64",
610
- 4
611
- ]
612
- }
613
- },
614
- {
615
- "name": "coopCloseVolume",
616
- "type": {
617
- "array": [
618
- "u64",
619
- 4
620
- ]
621
- }
622
- },
623
- {
624
- "name": "coopCloseCount",
625
- "type": {
626
- "array": [
627
- "u64",
628
- 4
629
- ]
630
- }
631
- },
632
- {
633
- "name": "bump",
634
- "type": "u8"
635
- }
636
- ]
637
- }
638
- }
639
- ],
640
- "types": [
641
- {
642
- "name": "SwapData",
643
- "type": {
644
- "kind": "struct",
645
- "fields": [
646
- {
647
- "name": "kind",
648
- "type": {
649
- "defined": "SwapType"
650
- }
651
- },
652
- {
653
- "name": "confirmations",
654
- "type": "u16"
655
- },
656
- {
657
- "name": "nonce",
658
- "type": "u64"
659
- },
660
- {
661
- "name": "hash",
662
- "type": {
663
- "array": [
664
- "u8",
665
- 32
666
- ]
667
- }
668
- },
669
- {
670
- "name": "payIn",
671
- "type": "bool"
672
- },
673
- {
674
- "name": "payOut",
675
- "type": "bool"
676
- },
677
- {
678
- "name": "amount",
679
- "type": "u64"
680
- },
681
- {
682
- "name": "expiry",
683
- "type": "u64"
684
- },
685
- {
686
- "name": "sequence",
687
- "type": "u64"
688
- }
689
- ]
690
- }
691
- },
692
- {
693
- "name": "SwapType",
694
- "type": {
695
- "kind": "enum",
696
- "variants": [
697
- {
698
- "name": "Htlc"
699
- },
700
- {
701
- "name": "Chain"
702
- },
703
- {
704
- "name": "ChainNonced"
705
- },
706
- {
707
- "name": "ChainTxhash"
708
- }
709
- ]
710
- }
711
- }
712
- ],
713
- "events": [
714
- {
715
- "name": "InitializeEvent",
716
- "fields": [
717
- {
718
- "name": "hash",
719
- "type": {
720
- "array": [
721
- "u8",
722
- 32
723
- ]
724
- },
725
- "index": false
726
- },
727
- {
728
- "name": "txoHash",
729
- "type": {
730
- "array": [
731
- "u8",
732
- 32
733
- ]
734
- },
735
- "index": false
736
- },
737
- {
738
- "name": "nonce",
739
- "type": "u64",
740
- "index": false
741
- },
742
- {
743
- "name": "kind",
744
- "type": {
745
- "defined": "SwapType"
746
- },
747
- "index": false
748
- },
749
- {
750
- "name": "sequence",
751
- "type": "u64",
752
- "index": false
753
- }
754
- ]
755
- },
756
- {
757
- "name": "RefundEvent",
758
- "fields": [
759
- {
760
- "name": "hash",
761
- "type": {
762
- "array": [
763
- "u8",
764
- 32
765
- ]
766
- },
767
- "index": false
768
- },
769
- {
770
- "name": "sequence",
771
- "type": "u64",
772
- "index": false
773
- }
774
- ]
775
- },
776
- {
777
- "name": "ClaimEvent",
778
- "fields": [
779
- {
780
- "name": "hash",
781
- "type": {
782
- "array": [
783
- "u8",
784
- 32
785
- ]
786
- },
787
- "index": false
788
- },
789
- {
790
- "name": "secret",
791
- "type": {
792
- "array": [
793
- "u8",
794
- 32
795
- ]
796
- },
797
- "index": false
798
- },
799
- {
800
- "name": "sequence",
801
- "type": "u64",
802
- "index": false
803
- }
804
- ]
805
- }
806
- ],
807
- "errors": [
808
- {
809
- "code": 6000,
810
- "name": "AuthExpired",
811
- "msg": "Authorization expired."
812
- },
813
- {
814
- "code": 6001,
815
- "name": "NotExpiredYet",
816
- "msg": "Request not expired yet."
817
- },
818
- {
819
- "code": 6002,
820
- "name": "AlreadyExpired",
821
- "msg": "Request already expired."
822
- },
823
- {
824
- "code": 6003,
825
- "name": "InvalidSecret",
826
- "msg": "Invalid secret provided."
827
- },
828
- {
829
- "code": 6004,
830
- "name": "InsufficientFunds",
831
- "msg": "Not enough funds."
832
- },
833
- {
834
- "code": 6005,
835
- "name": "KindUnknown",
836
- "msg": "Unknown type of the contract."
837
- },
838
- {
839
- "code": 6006,
840
- "name": "TooManyConfirmations",
841
- "msg": "Too many confirmations required."
842
- },
843
- {
844
- "code": 6007,
845
- "name": "InvalidTxVerifyProgramId",
846
- "msg": "Invalid program id for transaction verification."
847
- },
848
- {
849
- "code": 6008,
850
- "name": "InvalidTxVerifyIx",
851
- "msg": "Invalid instruction for transaction verification."
852
- },
853
- {
854
- "code": 6009,
855
- "name": "InvalidTxVerifyTxid",
856
- "msg": "Invalid txid for transaction verification."
857
- },
858
- {
859
- "code": 6010,
860
- "name": "InvalidTxVerifyConfirmations",
861
- "msg": "Invalid confirmations for transaction verification."
862
- },
863
- {
864
- "code": 6011,
865
- "name": "InvalidTx",
866
- "msg": "Invalid transaction/nSequence"
867
- },
868
- {
869
- "code": 6012,
870
- "name": "InvalidNonce",
871
- "msg": "Invalid nonce used"
872
- },
873
- {
874
- "code": 6013,
875
- "name": "InvalidVout",
876
- "msg": "Invalid vout of the output used"
877
- },
878
- {
879
- "code": 6014,
880
- "name": "InvalidAccountWritability",
881
- "msg": "Account cannot be written to"
882
- },
883
- {
884
- "code": 6015,
885
- "name": "InvalidDataAccount",
886
- "msg": "Invalid data account"
887
- },
888
- {
889
- "code": 6016,
890
- "name": "InvalidUserData",
891
- "msg": "Invalid user data account"
892
- },
893
- {
894
- "code": 6017,
895
- "name": "InvalidBlockheightVerifyProgramId",
896
- "msg": "Invalid program id for blockheight verification."
897
- },
898
- {
899
- "code": 6018,
900
- "name": "InvalidBlockheightVerifyIx",
901
- "msg": "Invalid instruction for blockheight verification."
902
- },
903
- {
904
- "code": 6019,
905
- "name": "InvalidBlockheightVerifyHeight",
906
- "msg": "Invalid height for blockheight verification."
907
- },
908
- {
909
- "code": 6020,
910
- "name": "InvalidBlockheightVerifyOperation",
911
- "msg": "Invalid operation for blockheight verification."
912
- },
913
- {
914
- "code": 6021,
915
- "name": "SignatureVerificationFailedInvalidProgram",
916
- "msg": "Signature verification failed: invalid ed25519 program id"
917
- },
918
- {
919
- "code": 6022,
920
- "name": "SignatureVerificationFailedAccountsLength",
921
- "msg": "Signature verification failed: invalid accounts length"
922
- },
923
- {
924
- "code": 6023,
925
- "name": "SignatureVerificationFailedDataLength",
926
- "msg": "Signature verification failed: invalid data length"
927
- },
928
- {
929
- "code": 6024,
930
- "name": "SignatureVerificationFailedInvalidHeader",
931
- "msg": "Signature verification failed: invalid header"
932
- },
933
- {
934
- "code": 6025,
935
- "name": "SignatureVerificationFailedInvalidData",
936
- "msg": "Signature verification failed: invalid data"
937
- },
938
- {
939
- "code": 6026,
940
- "name": "InvalidSwapDataPayIn",
941
- "msg": "Invalid swap data: pay in"
942
- },
943
- {
944
- "code": 6027,
945
- "name": "InvalidSwapDataNonce",
946
- "msg": "Invalid swap data: nonce"
947
- }
948
- ]
949
- };
950
-
951
- export const IDL: SwapProgramV2 = {
952
- "version": "0.2.0",
953
- "name": "swap_program",
954
- "instructions": [
955
- {
956
- "name": "deposit",
957
- "accounts": [
958
- {
959
- "name": "signer",
960
- "isMut": true,
961
- "isSigner": true
962
- },
963
- {
964
- "name": "signerAta",
965
- "isMut": true,
966
- "isSigner": false
967
- },
968
- {
969
- "name": "userData",
970
- "isMut": true,
971
- "isSigner": false
972
- },
973
- {
974
- "name": "vault",
975
- "isMut": true,
976
- "isSigner": false
977
- },
978
- {
979
- "name": "mint",
980
- "isMut": false,
981
- "isSigner": false
982
- },
983
- {
984
- "name": "systemProgram",
985
- "isMut": false,
986
- "isSigner": false
987
- },
988
- {
989
- "name": "tokenProgram",
990
- "isMut": false,
991
- "isSigner": false
992
- }
993
- ],
994
- "args": [
995
- {
996
- "name": "amount",
997
- "type": "u64"
998
- }
999
- ]
1000
- },
1001
- {
1002
- "name": "withdraw",
1003
- "accounts": [
1004
- {
1005
- "name": "signer",
1006
- "isMut": true,
1007
- "isSigner": true
1008
- },
1009
- {
1010
- "name": "signerAta",
1011
- "isMut": true,
1012
- "isSigner": false
1013
- },
1014
- {
1015
- "name": "userData",
1016
- "isMut": true,
1017
- "isSigner": false
1018
- },
1019
- {
1020
- "name": "vault",
1021
- "isMut": true,
1022
- "isSigner": false
1023
- },
1024
- {
1025
- "name": "mint",
1026
- "isMut": false,
1027
- "isSigner": false
1028
- },
1029
- {
1030
- "name": "tokenProgram",
1031
- "isMut": false,
1032
- "isSigner": false
1033
- }
1034
- ],
1035
- "args": [
1036
- {
1037
- "name": "amount",
1038
- "type": "u64"
1039
- }
1040
- ]
1041
- },
1042
- {
1043
- "name": "offererInitializePayIn",
1044
- "accounts": [
1045
- {
1046
- "name": "offerer",
1047
- "isMut": false,
1048
- "isSigner": true
1049
- },
1050
- {
1051
- "name": "claimer",
1052
- "isMut": false,
1053
- "isSigner": false
1054
- },
1055
- {
1056
- "name": "initializer",
1057
- "isMut": true,
1058
- "isSigner": true
1059
- },
1060
- {
1061
- "name": "offererAta",
1062
- "isMut": true,
1063
- "isSigner": false
1064
- },
1065
- {
1066
- "name": "escrowState",
1067
- "isMut": true,
1068
- "isSigner": false
1069
- },
1070
- {
1071
- "name": "vault",
1072
- "isMut": true,
1073
- "isSigner": false
1074
- },
1075
- {
1076
- "name": "mint",
1077
- "isMut": false,
1078
- "isSigner": false
1079
- },
1080
- {
1081
- "name": "systemProgram",
1082
- "isMut": false,
1083
- "isSigner": false
1084
- },
1085
- {
1086
- "name": "tokenProgram",
1087
- "isMut": false,
1088
- "isSigner": false
1089
- },
1090
- {
1091
- "name": "claimerUserData",
1092
- "isMut": false,
1093
- "isSigner": false,
1094
- "isOptional": true
1095
- },
1096
- {
1097
- "name": "claimerAta",
1098
- "isMut": false,
1099
- "isSigner": false,
1100
- "isOptional": true
1101
- }
1102
- ],
1103
- "args": [
1104
- {
1105
- "name": "swapData",
1106
- "type": {
1107
- "defined": "SwapData"
1108
- }
1109
- },
1110
- {
1111
- "name": "securityDeposit",
1112
- "type": "u64"
1113
- },
1114
- {
1115
- "name": "claimerBounty",
1116
- "type": "u64"
1117
- },
1118
- {
1119
- "name": "txoHash",
1120
- "type": {
1121
- "array": [
1122
- "u8",
1123
- 32
1124
- ]
1125
- }
1126
- },
1127
- {
1128
- "name": "authExpiry",
1129
- "type": "u64"
1130
- }
1131
- ]
1132
- },
1133
- {
1134
- "name": "offererInitialize",
1135
- "accounts": [
1136
- {
1137
- "name": "offerer",
1138
- "isMut": false,
1139
- "isSigner": true
1140
- },
1141
- {
1142
- "name": "claimer",
1143
- "isMut": false,
1144
- "isSigner": false
1145
- },
1146
- {
1147
- "name": "initializer",
1148
- "isMut": true,
1149
- "isSigner": true
1150
- },
1151
- {
1152
- "name": "offererUserData",
1153
- "isMut": true,
1154
- "isSigner": false
1155
- },
1156
- {
1157
- "name": "escrowState",
1158
- "isMut": true,
1159
- "isSigner": false
1160
- },
1161
- {
1162
- "name": "mint",
1163
- "isMut": false,
1164
- "isSigner": false
1165
- },
1166
- {
1167
- "name": "systemProgram",
1168
- "isMut": false,
1169
- "isSigner": false
1170
- },
1171
- {
1172
- "name": "claimerUserData",
1173
- "isMut": false,
1174
- "isSigner": false,
1175
- "isOptional": true
1176
- },
1177
- {
1178
- "name": "claimerAta",
1179
- "isMut": false,
1180
- "isSigner": false,
1181
- "isOptional": true
1182
- }
1183
- ],
1184
- "args": [
1185
- {
1186
- "name": "swapData",
1187
- "type": {
1188
- "defined": "SwapData"
1189
- }
1190
- },
1191
- {
1192
- "name": "securityDeposit",
1193
- "type": "u64"
1194
- },
1195
- {
1196
- "name": "claimerBounty",
1197
- "type": "u64"
1198
- },
1199
- {
1200
- "name": "txoHash",
1201
- "type": {
1202
- "array": [
1203
- "u8",
1204
- 32
1205
- ]
1206
- }
1207
- },
1208
- {
1209
- "name": "authExpiry",
1210
- "type": "u64"
1211
- }
1212
- ]
1213
- },
1214
- {
1215
- "name": "offererRefund",
1216
- "accounts": [
1217
- {
1218
- "name": "offerer",
1219
- "isMut": true,
1220
- "isSigner": false
1221
- },
1222
- {
1223
- "name": "claimer",
1224
- "isMut": true,
1225
- "isSigner": false
1226
- },
1227
- {
1228
- "name": "escrowState",
1229
- "isMut": true,
1230
- "isSigner": false
1231
- },
1232
- {
1233
- "name": "offererUserData",
1234
- "isMut": true,
1235
- "isSigner": false
1236
- },
1237
- {
1238
- "name": "claimerUserData",
1239
- "isMut": true,
1240
- "isSigner": false,
1241
- "isOptional": true
1242
- },
1243
- {
1244
- "name": "ixSysvar",
1245
- "isMut": false,
1246
- "isSigner": false,
1247
- "isOptional": true
1248
- }
1249
- ],
1250
- "args": [
1251
- {
1252
- "name": "authExpiry",
1253
- "type": "u64"
1254
- }
1255
- ]
1256
- },
1257
- {
1258
- "name": "offererRefundPayIn",
1259
- "accounts": [
1260
- {
1261
- "name": "offerer",
1262
- "isMut": true,
1263
- "isSigner": false
1264
- },
1265
- {
1266
- "name": "claimer",
1267
- "isMut": true,
1268
- "isSigner": false
1269
- },
1270
- {
1271
- "name": "offererAta",
1272
- "isMut": true,
1273
- "isSigner": false
1274
- },
1275
- {
1276
- "name": "escrowState",
1277
- "isMut": true,
1278
- "isSigner": false
1279
- },
1280
- {
1281
- "name": "vault",
1282
- "isMut": true,
1283
- "isSigner": false
1284
- },
1285
- {
1286
- "name": "tokenProgram",
1287
- "isMut": false,
1288
- "isSigner": false
1289
- },
1290
- {
1291
- "name": "claimerUserData",
1292
- "isMut": true,
1293
- "isSigner": false,
1294
- "isOptional": true
1295
- },
1296
- {
1297
- "name": "ixSysvar",
1298
- "isMut": false,
1299
- "isSigner": false,
1300
- "isOptional": true
1301
- }
1302
- ],
1303
- "args": [
1304
- {
1305
- "name": "authExpiry",
1306
- "type": "u64"
1307
- }
1308
- ]
1309
- },
1310
- {
1311
- "name": "claimerClaim",
1312
- "accounts": [
1313
- {
1314
- "name": "signer",
1315
- "isMut": true,
1316
- "isSigner": true
1317
- },
1318
- {
1319
- "name": "offerer",
1320
- "isMut": true,
1321
- "isSigner": false
1322
- },
1323
- {
1324
- "name": "claimer",
1325
- "isMut": true,
1326
- "isSigner": false
1327
- },
1328
- {
1329
- "name": "escrowState",
1330
- "isMut": true,
1331
- "isSigner": false
1332
- },
1333
- {
1334
- "name": "ixSysvar",
1335
- "isMut": false,
1336
- "isSigner": false
1337
- },
1338
- {
1339
- "name": "claimerUserData",
1340
- "isMut": true,
1341
- "isSigner": false
1342
- },
1343
- {
1344
- "name": "data",
1345
- "isMut": true,
1346
- "isSigner": false,
1347
- "isOptional": true
1348
- }
1349
- ],
1350
- "args": [
1351
- {
1352
- "name": "secret",
1353
- "type": "bytes"
1354
- }
1355
- ]
1356
- },
1357
- {
1358
- "name": "claimerClaimPayOut",
1359
- "accounts": [
1360
- {
1361
- "name": "signer",
1362
- "isMut": true,
1363
- "isSigner": true
1364
- },
1365
- {
1366
- "name": "offerer",
1367
- "isMut": true,
1368
- "isSigner": false
1369
- },
1370
- {
1371
- "name": "claimer",
1372
- "isMut": true,
1373
- "isSigner": false
1374
- },
1375
- {
1376
- "name": "escrowState",
1377
- "isMut": true,
1378
- "isSigner": false
1379
- },
1380
- {
1381
- "name": "ixSysvar",
1382
- "isMut": false,
1383
- "isSigner": false
1384
- },
1385
- {
1386
- "name": "claimerAta",
1387
- "isMut": true,
1388
- "isSigner": false
1389
- },
1390
- {
1391
- "name": "vault",
1392
- "isMut": true,
1393
- "isSigner": false
1394
- },
1395
- {
1396
- "name": "tokenProgram",
1397
- "isMut": false,
1398
- "isSigner": false
1399
- },
1400
- {
1401
- "name": "data",
1402
- "isMut": true,
1403
- "isSigner": false,
1404
- "isOptional": true
1405
- }
1406
- ],
1407
- "args": [
1408
- {
1409
- "name": "secret",
1410
- "type": "bytes"
1411
- }
1412
- ]
1413
- },
1414
- {
1415
- "name": "initData",
1416
- "accounts": [
1417
- {
1418
- "name": "signer",
1419
- "isMut": true,
1420
- "isSigner": true
1421
- },
1422
- {
1423
- "name": "data",
1424
- "isMut": true,
1425
- "isSigner": true
1426
- }
1427
- ],
1428
- "args": []
1429
- },
1430
- {
1431
- "name": "writeData",
1432
- "accounts": [
1433
- {
1434
- "name": "signer",
1435
- "isMut": true,
1436
- "isSigner": true
1437
- },
1438
- {
1439
- "name": "data",
1440
- "isMut": true,
1441
- "isSigner": false
1442
- }
1443
- ],
1444
- "args": [
1445
- {
1446
- "name": "start",
1447
- "type": "u32"
1448
- },
1449
- {
1450
- "name": "data",
1451
- "type": "bytes"
1452
- }
1453
- ]
1454
- },
1455
- {
1456
- "name": "closeData",
1457
- "accounts": [
1458
- {
1459
- "name": "signer",
1460
- "isMut": true,
1461
- "isSigner": true
1462
- },
1463
- {
1464
- "name": "data",
1465
- "isMut": true,
1466
- "isSigner": false
1467
- }
1468
- ],
1469
- "args": []
1470
- }
1471
- ],
1472
- "accounts": [
1473
- {
1474
- "name": "escrowState",
1475
- "type": {
1476
- "kind": "struct",
1477
- "fields": [
1478
- {
1479
- "name": "data",
1480
- "type": {
1481
- "defined": "SwapData"
1482
- }
1483
- },
1484
- {
1485
- "name": "offerer",
1486
- "type": "publicKey"
1487
- },
1488
- {
1489
- "name": "offererAta",
1490
- "type": "publicKey"
1491
- },
1492
- {
1493
- "name": "claimer",
1494
- "type": "publicKey"
1495
- },
1496
- {
1497
- "name": "claimerAta",
1498
- "type": "publicKey"
1499
- },
1500
- {
1501
- "name": "mint",
1502
- "type": "publicKey"
1503
- },
1504
- {
1505
- "name": "claimerBounty",
1506
- "type": "u64"
1507
- },
1508
- {
1509
- "name": "securityDeposit",
1510
- "type": "u64"
1511
- },
1512
- {
1513
- "name": "offererInitializer",
1514
- "type": "bool"
1515
- }
1516
- ]
1517
- }
1518
- },
1519
- {
1520
- "name": "userAccount",
1521
- "type": {
1522
- "kind": "struct",
1523
- "fields": [
1524
- {
1525
- "name": "amount",
1526
- "type": "u64"
1527
- },
1528
- {
1529
- "name": "successVolume",
1530
- "type": {
1531
- "array": [
1532
- "u64",
1533
- 4
1534
- ]
1535
- }
1536
- },
1537
- {
1538
- "name": "successCount",
1539
- "type": {
1540
- "array": [
1541
- "u64",
1542
- 4
1543
- ]
1544
- }
1545
- },
1546
- {
1547
- "name": "failVolume",
1548
- "type": {
1549
- "array": [
1550
- "u64",
1551
- 4
1552
- ]
1553
- }
1554
- },
1555
- {
1556
- "name": "failCount",
1557
- "type": {
1558
- "array": [
1559
- "u64",
1560
- 4
1561
- ]
1562
- }
1563
- },
1564
- {
1565
- "name": "coopCloseVolume",
1566
- "type": {
1567
- "array": [
1568
- "u64",
1569
- 4
1570
- ]
1571
- }
1572
- },
1573
- {
1574
- "name": "coopCloseCount",
1575
- "type": {
1576
- "array": [
1577
- "u64",
1578
- 4
1579
- ]
1580
- }
1581
- },
1582
- {
1583
- "name": "bump",
1584
- "type": "u8"
1585
- }
1586
- ]
1587
- }
1588
- }
1589
- ],
1590
- "types": [
1591
- {
1592
- "name": "SwapData",
1593
- "type": {
1594
- "kind": "struct",
1595
- "fields": [
1596
- {
1597
- "name": "kind",
1598
- "type": {
1599
- "defined": "SwapType"
1600
- }
1601
- },
1602
- {
1603
- "name": "confirmations",
1604
- "type": "u16"
1605
- },
1606
- {
1607
- "name": "nonce",
1608
- "type": "u64"
1609
- },
1610
- {
1611
- "name": "hash",
1612
- "type": {
1613
- "array": [
1614
- "u8",
1615
- 32
1616
- ]
1617
- }
1618
- },
1619
- {
1620
- "name": "payIn",
1621
- "type": "bool"
1622
- },
1623
- {
1624
- "name": "payOut",
1625
- "type": "bool"
1626
- },
1627
- {
1628
- "name": "amount",
1629
- "type": "u64"
1630
- },
1631
- {
1632
- "name": "expiry",
1633
- "type": "u64"
1634
- },
1635
- {
1636
- "name": "sequence",
1637
- "type": "u64"
1638
- }
1639
- ]
1640
- }
1641
- },
1642
- {
1643
- "name": "SwapType",
1644
- "type": {
1645
- "kind": "enum",
1646
- "variants": [
1647
- {
1648
- "name": "Htlc"
1649
- },
1650
- {
1651
- "name": "Chain"
1652
- },
1653
- {
1654
- "name": "ChainNonced"
1655
- },
1656
- {
1657
- "name": "ChainTxhash"
1658
- }
1659
- ]
1660
- }
1661
- }
1662
- ],
1663
- "events": [
1664
- {
1665
- "name": "InitializeEvent",
1666
- "fields": [
1667
- {
1668
- "name": "hash",
1669
- "type": {
1670
- "array": [
1671
- "u8",
1672
- 32
1673
- ]
1674
- },
1675
- "index": false
1676
- },
1677
- {
1678
- "name": "txoHash",
1679
- "type": {
1680
- "array": [
1681
- "u8",
1682
- 32
1683
- ]
1684
- },
1685
- "index": false
1686
- },
1687
- {
1688
- "name": "nonce",
1689
- "type": "u64",
1690
- "index": false
1691
- },
1692
- {
1693
- "name": "kind",
1694
- "type": {
1695
- "defined": "SwapType"
1696
- },
1697
- "index": false
1698
- },
1699
- {
1700
- "name": "sequence",
1701
- "type": "u64",
1702
- "index": false
1703
- }
1704
- ]
1705
- },
1706
- {
1707
- "name": "RefundEvent",
1708
- "fields": [
1709
- {
1710
- "name": "hash",
1711
- "type": {
1712
- "array": [
1713
- "u8",
1714
- 32
1715
- ]
1716
- },
1717
- "index": false
1718
- },
1719
- {
1720
- "name": "sequence",
1721
- "type": "u64",
1722
- "index": false
1723
- }
1724
- ]
1725
- },
1726
- {
1727
- "name": "ClaimEvent",
1728
- "fields": [
1729
- {
1730
- "name": "hash",
1731
- "type": {
1732
- "array": [
1733
- "u8",
1734
- 32
1735
- ]
1736
- },
1737
- "index": false
1738
- },
1739
- {
1740
- "name": "secret",
1741
- "type": {
1742
- "array": [
1743
- "u8",
1744
- 32
1745
- ]
1746
- },
1747
- "index": false
1748
- },
1749
- {
1750
- "name": "sequence",
1751
- "type": "u64",
1752
- "index": false
1753
- }
1754
- ]
1755
- }
1756
- ],
1757
- "errors": [
1758
- {
1759
- "code": 6000,
1760
- "name": "AuthExpired",
1761
- "msg": "Authorization expired."
1762
- },
1763
- {
1764
- "code": 6001,
1765
- "name": "NotExpiredYet",
1766
- "msg": "Request not expired yet."
1767
- },
1768
- {
1769
- "code": 6002,
1770
- "name": "AlreadyExpired",
1771
- "msg": "Request already expired."
1772
- },
1773
- {
1774
- "code": 6003,
1775
- "name": "InvalidSecret",
1776
- "msg": "Invalid secret provided."
1777
- },
1778
- {
1779
- "code": 6004,
1780
- "name": "InsufficientFunds",
1781
- "msg": "Not enough funds."
1782
- },
1783
- {
1784
- "code": 6005,
1785
- "name": "KindUnknown",
1786
- "msg": "Unknown type of the contract."
1787
- },
1788
- {
1789
- "code": 6006,
1790
- "name": "TooManyConfirmations",
1791
- "msg": "Too many confirmations required."
1792
- },
1793
- {
1794
- "code": 6007,
1795
- "name": "InvalidTxVerifyProgramId",
1796
- "msg": "Invalid program id for transaction verification."
1797
- },
1798
- {
1799
- "code": 6008,
1800
- "name": "InvalidTxVerifyIx",
1801
- "msg": "Invalid instruction for transaction verification."
1802
- },
1803
- {
1804
- "code": 6009,
1805
- "name": "InvalidTxVerifyTxid",
1806
- "msg": "Invalid txid for transaction verification."
1807
- },
1808
- {
1809
- "code": 6010,
1810
- "name": "InvalidTxVerifyConfirmations",
1811
- "msg": "Invalid confirmations for transaction verification."
1812
- },
1813
- {
1814
- "code": 6011,
1815
- "name": "InvalidTx",
1816
- "msg": "Invalid transaction/nSequence"
1817
- },
1818
- {
1819
- "code": 6012,
1820
- "name": "InvalidNonce",
1821
- "msg": "Invalid nonce used"
1822
- },
1823
- {
1824
- "code": 6013,
1825
- "name": "InvalidVout",
1826
- "msg": "Invalid vout of the output used"
1827
- },
1828
- {
1829
- "code": 6014,
1830
- "name": "InvalidAccountWritability",
1831
- "msg": "Account cannot be written to"
1832
- },
1833
- {
1834
- "code": 6015,
1835
- "name": "InvalidDataAccount",
1836
- "msg": "Invalid data account"
1837
- },
1838
- {
1839
- "code": 6016,
1840
- "name": "InvalidUserData",
1841
- "msg": "Invalid user data account"
1842
- },
1843
- {
1844
- "code": 6017,
1845
- "name": "InvalidBlockheightVerifyProgramId",
1846
- "msg": "Invalid program id for blockheight verification."
1847
- },
1848
- {
1849
- "code": 6018,
1850
- "name": "InvalidBlockheightVerifyIx",
1851
- "msg": "Invalid instruction for blockheight verification."
1852
- },
1853
- {
1854
- "code": 6019,
1855
- "name": "InvalidBlockheightVerifyHeight",
1856
- "msg": "Invalid height for blockheight verification."
1857
- },
1858
- {
1859
- "code": 6020,
1860
- "name": "InvalidBlockheightVerifyOperation",
1861
- "msg": "Invalid operation for blockheight verification."
1862
- },
1863
- {
1864
- "code": 6021,
1865
- "name": "SignatureVerificationFailedInvalidProgram",
1866
- "msg": "Signature verification failed: invalid ed25519 program id"
1867
- },
1868
- {
1869
- "code": 6022,
1870
- "name": "SignatureVerificationFailedAccountsLength",
1871
- "msg": "Signature verification failed: invalid accounts length"
1872
- },
1873
- {
1874
- "code": 6023,
1875
- "name": "SignatureVerificationFailedDataLength",
1876
- "msg": "Signature verification failed: invalid data length"
1877
- },
1878
- {
1879
- "code": 6024,
1880
- "name": "SignatureVerificationFailedInvalidHeader",
1881
- "msg": "Signature verification failed: invalid header"
1882
- },
1883
- {
1884
- "code": 6025,
1885
- "name": "SignatureVerificationFailedInvalidData",
1886
- "msg": "Signature verification failed: invalid data"
1887
- },
1888
- {
1889
- "code": 6026,
1890
- "name": "InvalidSwapDataPayIn",
1891
- "msg": "Invalid swap data: pay in"
1892
- },
1893
- {
1894
- "code": 6027,
1895
- "name": "InvalidSwapDataNonce",
1896
- "msg": "Invalid swap data: nonce"
1897
- }
1898
- ]
1899
- };
1
+ export type SwapProgramV2 = {
2
+ "version": "0.2.0",
3
+ "name": "swap_program",
4
+ "instructions": [
5
+ {
6
+ "name": "deposit",
7
+ "accounts": [
8
+ {
9
+ "name": "signer",
10
+ "isMut": true,
11
+ "isSigner": true
12
+ },
13
+ {
14
+ "name": "signerAta",
15
+ "isMut": true,
16
+ "isSigner": false
17
+ },
18
+ {
19
+ "name": "userData",
20
+ "isMut": true,
21
+ "isSigner": false
22
+ },
23
+ {
24
+ "name": "vault",
25
+ "isMut": true,
26
+ "isSigner": false
27
+ },
28
+ {
29
+ "name": "mint",
30
+ "isMut": false,
31
+ "isSigner": false
32
+ },
33
+ {
34
+ "name": "systemProgram",
35
+ "isMut": false,
36
+ "isSigner": false
37
+ },
38
+ {
39
+ "name": "tokenProgram",
40
+ "isMut": false,
41
+ "isSigner": false
42
+ }
43
+ ],
44
+ "args": [
45
+ {
46
+ "name": "amount",
47
+ "type": "u64"
48
+ }
49
+ ]
50
+ },
51
+ {
52
+ "name": "withdraw",
53
+ "accounts": [
54
+ {
55
+ "name": "signer",
56
+ "isMut": true,
57
+ "isSigner": true
58
+ },
59
+ {
60
+ "name": "signerAta",
61
+ "isMut": true,
62
+ "isSigner": false
63
+ },
64
+ {
65
+ "name": "userData",
66
+ "isMut": true,
67
+ "isSigner": false
68
+ },
69
+ {
70
+ "name": "vault",
71
+ "isMut": true,
72
+ "isSigner": false
73
+ },
74
+ {
75
+ "name": "mint",
76
+ "isMut": false,
77
+ "isSigner": false
78
+ },
79
+ {
80
+ "name": "tokenProgram",
81
+ "isMut": false,
82
+ "isSigner": false
83
+ }
84
+ ],
85
+ "args": [
86
+ {
87
+ "name": "amount",
88
+ "type": "u64"
89
+ }
90
+ ]
91
+ },
92
+ {
93
+ "name": "offererInitializePayIn",
94
+ "accounts": [
95
+ {
96
+ "name": "offerer",
97
+ "isMut": false,
98
+ "isSigner": true
99
+ },
100
+ {
101
+ "name": "claimer",
102
+ "isMut": false,
103
+ "isSigner": false
104
+ },
105
+ {
106
+ "name": "initializer",
107
+ "isMut": true,
108
+ "isSigner": true
109
+ },
110
+ {
111
+ "name": "offererAta",
112
+ "isMut": true,
113
+ "isSigner": false
114
+ },
115
+ {
116
+ "name": "escrowState",
117
+ "isMut": true,
118
+ "isSigner": false
119
+ },
120
+ {
121
+ "name": "vault",
122
+ "isMut": true,
123
+ "isSigner": false
124
+ },
125
+ {
126
+ "name": "mint",
127
+ "isMut": false,
128
+ "isSigner": false
129
+ },
130
+ {
131
+ "name": "systemProgram",
132
+ "isMut": false,
133
+ "isSigner": false
134
+ },
135
+ {
136
+ "name": "tokenProgram",
137
+ "isMut": false,
138
+ "isSigner": false
139
+ },
140
+ {
141
+ "name": "claimerUserData",
142
+ "isMut": false,
143
+ "isSigner": false,
144
+ "isOptional": true
145
+ },
146
+ {
147
+ "name": "claimerAta",
148
+ "isMut": false,
149
+ "isSigner": false,
150
+ "isOptional": true
151
+ }
152
+ ],
153
+ "args": [
154
+ {
155
+ "name": "swapData",
156
+ "type": {
157
+ "defined": "SwapData"
158
+ }
159
+ },
160
+ {
161
+ "name": "securityDeposit",
162
+ "type": "u64"
163
+ },
164
+ {
165
+ "name": "claimerBounty",
166
+ "type": "u64"
167
+ },
168
+ {
169
+ "name": "txoHash",
170
+ "type": {
171
+ "array": [
172
+ "u8",
173
+ 32
174
+ ]
175
+ }
176
+ },
177
+ {
178
+ "name": "authExpiry",
179
+ "type": "u64"
180
+ }
181
+ ]
182
+ },
183
+ {
184
+ "name": "offererInitialize",
185
+ "accounts": [
186
+ {
187
+ "name": "offerer",
188
+ "isMut": false,
189
+ "isSigner": true
190
+ },
191
+ {
192
+ "name": "claimer",
193
+ "isMut": false,
194
+ "isSigner": false
195
+ },
196
+ {
197
+ "name": "initializer",
198
+ "isMut": true,
199
+ "isSigner": true
200
+ },
201
+ {
202
+ "name": "offererUserData",
203
+ "isMut": true,
204
+ "isSigner": false
205
+ },
206
+ {
207
+ "name": "escrowState",
208
+ "isMut": true,
209
+ "isSigner": false
210
+ },
211
+ {
212
+ "name": "mint",
213
+ "isMut": false,
214
+ "isSigner": false
215
+ },
216
+ {
217
+ "name": "systemProgram",
218
+ "isMut": false,
219
+ "isSigner": false
220
+ },
221
+ {
222
+ "name": "claimerUserData",
223
+ "isMut": false,
224
+ "isSigner": false,
225
+ "isOptional": true
226
+ },
227
+ {
228
+ "name": "claimerAta",
229
+ "isMut": false,
230
+ "isSigner": false,
231
+ "isOptional": true
232
+ }
233
+ ],
234
+ "args": [
235
+ {
236
+ "name": "swapData",
237
+ "type": {
238
+ "defined": "SwapData"
239
+ }
240
+ },
241
+ {
242
+ "name": "securityDeposit",
243
+ "type": "u64"
244
+ },
245
+ {
246
+ "name": "claimerBounty",
247
+ "type": "u64"
248
+ },
249
+ {
250
+ "name": "txoHash",
251
+ "type": {
252
+ "array": [
253
+ "u8",
254
+ 32
255
+ ]
256
+ }
257
+ },
258
+ {
259
+ "name": "authExpiry",
260
+ "type": "u64"
261
+ }
262
+ ]
263
+ },
264
+ {
265
+ "name": "offererRefund",
266
+ "accounts": [
267
+ {
268
+ "name": "offerer",
269
+ "isMut": true,
270
+ "isSigner": false
271
+ },
272
+ {
273
+ "name": "claimer",
274
+ "isMut": true,
275
+ "isSigner": false
276
+ },
277
+ {
278
+ "name": "escrowState",
279
+ "isMut": true,
280
+ "isSigner": false
281
+ },
282
+ {
283
+ "name": "offererUserData",
284
+ "isMut": true,
285
+ "isSigner": false
286
+ },
287
+ {
288
+ "name": "claimerUserData",
289
+ "isMut": true,
290
+ "isSigner": false,
291
+ "isOptional": true
292
+ },
293
+ {
294
+ "name": "ixSysvar",
295
+ "isMut": false,
296
+ "isSigner": false,
297
+ "isOptional": true
298
+ }
299
+ ],
300
+ "args": [
301
+ {
302
+ "name": "authExpiry",
303
+ "type": "u64"
304
+ }
305
+ ]
306
+ },
307
+ {
308
+ "name": "offererRefundPayIn",
309
+ "accounts": [
310
+ {
311
+ "name": "offerer",
312
+ "isMut": true,
313
+ "isSigner": false
314
+ },
315
+ {
316
+ "name": "claimer",
317
+ "isMut": true,
318
+ "isSigner": false
319
+ },
320
+ {
321
+ "name": "offererAta",
322
+ "isMut": true,
323
+ "isSigner": false
324
+ },
325
+ {
326
+ "name": "escrowState",
327
+ "isMut": true,
328
+ "isSigner": false
329
+ },
330
+ {
331
+ "name": "vault",
332
+ "isMut": true,
333
+ "isSigner": false
334
+ },
335
+ {
336
+ "name": "tokenProgram",
337
+ "isMut": false,
338
+ "isSigner": false
339
+ },
340
+ {
341
+ "name": "claimerUserData",
342
+ "isMut": true,
343
+ "isSigner": false,
344
+ "isOptional": true
345
+ },
346
+ {
347
+ "name": "ixSysvar",
348
+ "isMut": false,
349
+ "isSigner": false,
350
+ "isOptional": true
351
+ }
352
+ ],
353
+ "args": [
354
+ {
355
+ "name": "authExpiry",
356
+ "type": "u64"
357
+ }
358
+ ]
359
+ },
360
+ {
361
+ "name": "claimerClaim",
362
+ "accounts": [
363
+ {
364
+ "name": "signer",
365
+ "isMut": true,
366
+ "isSigner": true
367
+ },
368
+ {
369
+ "name": "offerer",
370
+ "isMut": true,
371
+ "isSigner": false
372
+ },
373
+ {
374
+ "name": "claimer",
375
+ "isMut": true,
376
+ "isSigner": false
377
+ },
378
+ {
379
+ "name": "escrowState",
380
+ "isMut": true,
381
+ "isSigner": false
382
+ },
383
+ {
384
+ "name": "ixSysvar",
385
+ "isMut": false,
386
+ "isSigner": false
387
+ },
388
+ {
389
+ "name": "claimerUserData",
390
+ "isMut": true,
391
+ "isSigner": false
392
+ },
393
+ {
394
+ "name": "data",
395
+ "isMut": true,
396
+ "isSigner": false,
397
+ "isOptional": true
398
+ }
399
+ ],
400
+ "args": [
401
+ {
402
+ "name": "secret",
403
+ "type": "bytes"
404
+ }
405
+ ]
406
+ },
407
+ {
408
+ "name": "claimerClaimPayOut",
409
+ "accounts": [
410
+ {
411
+ "name": "signer",
412
+ "isMut": true,
413
+ "isSigner": true
414
+ },
415
+ {
416
+ "name": "offerer",
417
+ "isMut": true,
418
+ "isSigner": false
419
+ },
420
+ {
421
+ "name": "claimer",
422
+ "isMut": true,
423
+ "isSigner": false
424
+ },
425
+ {
426
+ "name": "escrowState",
427
+ "isMut": true,
428
+ "isSigner": false
429
+ },
430
+ {
431
+ "name": "ixSysvar",
432
+ "isMut": false,
433
+ "isSigner": false
434
+ },
435
+ {
436
+ "name": "claimerAta",
437
+ "isMut": true,
438
+ "isSigner": false
439
+ },
440
+ {
441
+ "name": "vault",
442
+ "isMut": true,
443
+ "isSigner": false
444
+ },
445
+ {
446
+ "name": "tokenProgram",
447
+ "isMut": false,
448
+ "isSigner": false
449
+ },
450
+ {
451
+ "name": "data",
452
+ "isMut": true,
453
+ "isSigner": false,
454
+ "isOptional": true
455
+ }
456
+ ],
457
+ "args": [
458
+ {
459
+ "name": "secret",
460
+ "type": "bytes"
461
+ }
462
+ ]
463
+ },
464
+ {
465
+ "name": "initData",
466
+ "accounts": [
467
+ {
468
+ "name": "signer",
469
+ "isMut": true,
470
+ "isSigner": true
471
+ },
472
+ {
473
+ "name": "data",
474
+ "isMut": true,
475
+ "isSigner": true
476
+ }
477
+ ],
478
+ "args": []
479
+ },
480
+ {
481
+ "name": "writeData",
482
+ "accounts": [
483
+ {
484
+ "name": "signer",
485
+ "isMut": true,
486
+ "isSigner": true
487
+ },
488
+ {
489
+ "name": "data",
490
+ "isMut": true,
491
+ "isSigner": false
492
+ }
493
+ ],
494
+ "args": [
495
+ {
496
+ "name": "start",
497
+ "type": "u32"
498
+ },
499
+ {
500
+ "name": "data",
501
+ "type": "bytes"
502
+ }
503
+ ]
504
+ },
505
+ {
506
+ "name": "closeData",
507
+ "accounts": [
508
+ {
509
+ "name": "signer",
510
+ "isMut": true,
511
+ "isSigner": true
512
+ },
513
+ {
514
+ "name": "data",
515
+ "isMut": true,
516
+ "isSigner": false
517
+ }
518
+ ],
519
+ "args": []
520
+ }
521
+ ],
522
+ "accounts": [
523
+ {
524
+ "name": "escrowState",
525
+ "type": {
526
+ "kind": "struct",
527
+ "fields": [
528
+ {
529
+ "name": "data",
530
+ "type": {
531
+ "defined": "SwapData"
532
+ }
533
+ },
534
+ {
535
+ "name": "offerer",
536
+ "type": "publicKey"
537
+ },
538
+ {
539
+ "name": "offererAta",
540
+ "type": "publicKey"
541
+ },
542
+ {
543
+ "name": "claimer",
544
+ "type": "publicKey"
545
+ },
546
+ {
547
+ "name": "claimerAta",
548
+ "type": "publicKey"
549
+ },
550
+ {
551
+ "name": "mint",
552
+ "type": "publicKey"
553
+ },
554
+ {
555
+ "name": "claimerBounty",
556
+ "type": "u64"
557
+ },
558
+ {
559
+ "name": "securityDeposit",
560
+ "type": "u64"
561
+ },
562
+ {
563
+ "name": "offererInitializer",
564
+ "type": "bool"
565
+ }
566
+ ]
567
+ }
568
+ },
569
+ {
570
+ "name": "userAccount",
571
+ "type": {
572
+ "kind": "struct",
573
+ "fields": [
574
+ {
575
+ "name": "amount",
576
+ "type": "u64"
577
+ },
578
+ {
579
+ "name": "successVolume",
580
+ "type": {
581
+ "array": [
582
+ "u64",
583
+ 4
584
+ ]
585
+ }
586
+ },
587
+ {
588
+ "name": "successCount",
589
+ "type": {
590
+ "array": [
591
+ "u64",
592
+ 4
593
+ ]
594
+ }
595
+ },
596
+ {
597
+ "name": "failVolume",
598
+ "type": {
599
+ "array": [
600
+ "u64",
601
+ 4
602
+ ]
603
+ }
604
+ },
605
+ {
606
+ "name": "failCount",
607
+ "type": {
608
+ "array": [
609
+ "u64",
610
+ 4
611
+ ]
612
+ }
613
+ },
614
+ {
615
+ "name": "coopCloseVolume",
616
+ "type": {
617
+ "array": [
618
+ "u64",
619
+ 4
620
+ ]
621
+ }
622
+ },
623
+ {
624
+ "name": "coopCloseCount",
625
+ "type": {
626
+ "array": [
627
+ "u64",
628
+ 4
629
+ ]
630
+ }
631
+ },
632
+ {
633
+ "name": "bump",
634
+ "type": "u8"
635
+ }
636
+ ]
637
+ }
638
+ }
639
+ ],
640
+ "types": [
641
+ {
642
+ "name": "SwapData",
643
+ "type": {
644
+ "kind": "struct",
645
+ "fields": [
646
+ {
647
+ "name": "kind",
648
+ "type": {
649
+ "defined": "SwapType"
650
+ }
651
+ },
652
+ {
653
+ "name": "confirmations",
654
+ "type": "u16"
655
+ },
656
+ {
657
+ "name": "nonce",
658
+ "type": "u64"
659
+ },
660
+ {
661
+ "name": "hash",
662
+ "type": {
663
+ "array": [
664
+ "u8",
665
+ 32
666
+ ]
667
+ }
668
+ },
669
+ {
670
+ "name": "payIn",
671
+ "type": "bool"
672
+ },
673
+ {
674
+ "name": "payOut",
675
+ "type": "bool"
676
+ },
677
+ {
678
+ "name": "amount",
679
+ "type": "u64"
680
+ },
681
+ {
682
+ "name": "expiry",
683
+ "type": "u64"
684
+ },
685
+ {
686
+ "name": "sequence",
687
+ "type": "u64"
688
+ }
689
+ ]
690
+ }
691
+ },
692
+ {
693
+ "name": "SwapType",
694
+ "type": {
695
+ "kind": "enum",
696
+ "variants": [
697
+ {
698
+ "name": "Htlc"
699
+ },
700
+ {
701
+ "name": "Chain"
702
+ },
703
+ {
704
+ "name": "ChainNonced"
705
+ },
706
+ {
707
+ "name": "ChainTxhash"
708
+ }
709
+ ]
710
+ }
711
+ }
712
+ ],
713
+ "events": [
714
+ {
715
+ "name": "InitializeEvent",
716
+ "fields": [
717
+ {
718
+ "name": "hash",
719
+ "type": {
720
+ "array": [
721
+ "u8",
722
+ 32
723
+ ]
724
+ },
725
+ "index": false
726
+ },
727
+ {
728
+ "name": "txoHash",
729
+ "type": {
730
+ "array": [
731
+ "u8",
732
+ 32
733
+ ]
734
+ },
735
+ "index": false
736
+ },
737
+ {
738
+ "name": "nonce",
739
+ "type": "u64",
740
+ "index": false
741
+ },
742
+ {
743
+ "name": "kind",
744
+ "type": {
745
+ "defined": "SwapType"
746
+ },
747
+ "index": false
748
+ },
749
+ {
750
+ "name": "sequence",
751
+ "type": "u64",
752
+ "index": false
753
+ }
754
+ ]
755
+ },
756
+ {
757
+ "name": "RefundEvent",
758
+ "fields": [
759
+ {
760
+ "name": "hash",
761
+ "type": {
762
+ "array": [
763
+ "u8",
764
+ 32
765
+ ]
766
+ },
767
+ "index": false
768
+ },
769
+ {
770
+ "name": "sequence",
771
+ "type": "u64",
772
+ "index": false
773
+ }
774
+ ]
775
+ },
776
+ {
777
+ "name": "ClaimEvent",
778
+ "fields": [
779
+ {
780
+ "name": "hash",
781
+ "type": {
782
+ "array": [
783
+ "u8",
784
+ 32
785
+ ]
786
+ },
787
+ "index": false
788
+ },
789
+ {
790
+ "name": "secret",
791
+ "type": {
792
+ "array": [
793
+ "u8",
794
+ 32
795
+ ]
796
+ },
797
+ "index": false
798
+ },
799
+ {
800
+ "name": "sequence",
801
+ "type": "u64",
802
+ "index": false
803
+ }
804
+ ]
805
+ }
806
+ ],
807
+ "errors": [
808
+ {
809
+ "code": 6000,
810
+ "name": "AuthExpired",
811
+ "msg": "Authorization expired."
812
+ },
813
+ {
814
+ "code": 6001,
815
+ "name": "NotExpiredYet",
816
+ "msg": "Request not expired yet."
817
+ },
818
+ {
819
+ "code": 6002,
820
+ "name": "AlreadyExpired",
821
+ "msg": "Request already expired."
822
+ },
823
+ {
824
+ "code": 6003,
825
+ "name": "InvalidSecret",
826
+ "msg": "Invalid secret provided."
827
+ },
828
+ {
829
+ "code": 6004,
830
+ "name": "InsufficientFunds",
831
+ "msg": "Not enough funds."
832
+ },
833
+ {
834
+ "code": 6005,
835
+ "name": "KindUnknown",
836
+ "msg": "Unknown type of the contract."
837
+ },
838
+ {
839
+ "code": 6006,
840
+ "name": "TooManyConfirmations",
841
+ "msg": "Too many confirmations required."
842
+ },
843
+ {
844
+ "code": 6007,
845
+ "name": "InvalidTxVerifyProgramId",
846
+ "msg": "Invalid program id for transaction verification."
847
+ },
848
+ {
849
+ "code": 6008,
850
+ "name": "InvalidTxVerifyIx",
851
+ "msg": "Invalid instruction for transaction verification."
852
+ },
853
+ {
854
+ "code": 6009,
855
+ "name": "InvalidTxVerifyTxid",
856
+ "msg": "Invalid txid for transaction verification."
857
+ },
858
+ {
859
+ "code": 6010,
860
+ "name": "InvalidTxVerifyConfirmations",
861
+ "msg": "Invalid confirmations for transaction verification."
862
+ },
863
+ {
864
+ "code": 6011,
865
+ "name": "InvalidTx",
866
+ "msg": "Invalid transaction/nSequence"
867
+ },
868
+ {
869
+ "code": 6012,
870
+ "name": "InvalidNonce",
871
+ "msg": "Invalid nonce used"
872
+ },
873
+ {
874
+ "code": 6013,
875
+ "name": "InvalidVout",
876
+ "msg": "Invalid vout of the output used"
877
+ },
878
+ {
879
+ "code": 6014,
880
+ "name": "InvalidAccountWritability",
881
+ "msg": "Account cannot be written to"
882
+ },
883
+ {
884
+ "code": 6015,
885
+ "name": "InvalidDataAccount",
886
+ "msg": "Invalid data account"
887
+ },
888
+ {
889
+ "code": 6016,
890
+ "name": "InvalidUserData",
891
+ "msg": "Invalid user data account"
892
+ },
893
+ {
894
+ "code": 6017,
895
+ "name": "InvalidBlockheightVerifyProgramId",
896
+ "msg": "Invalid program id for blockheight verification."
897
+ },
898
+ {
899
+ "code": 6018,
900
+ "name": "InvalidBlockheightVerifyIx",
901
+ "msg": "Invalid instruction for blockheight verification."
902
+ },
903
+ {
904
+ "code": 6019,
905
+ "name": "InvalidBlockheightVerifyHeight",
906
+ "msg": "Invalid height for blockheight verification."
907
+ },
908
+ {
909
+ "code": 6020,
910
+ "name": "InvalidBlockheightVerifyOperation",
911
+ "msg": "Invalid operation for blockheight verification."
912
+ },
913
+ {
914
+ "code": 6021,
915
+ "name": "SignatureVerificationFailedInvalidProgram",
916
+ "msg": "Signature verification failed: invalid ed25519 program id"
917
+ },
918
+ {
919
+ "code": 6022,
920
+ "name": "SignatureVerificationFailedAccountsLength",
921
+ "msg": "Signature verification failed: invalid accounts length"
922
+ },
923
+ {
924
+ "code": 6023,
925
+ "name": "SignatureVerificationFailedDataLength",
926
+ "msg": "Signature verification failed: invalid data length"
927
+ },
928
+ {
929
+ "code": 6024,
930
+ "name": "SignatureVerificationFailedInvalidHeader",
931
+ "msg": "Signature verification failed: invalid header"
932
+ },
933
+ {
934
+ "code": 6025,
935
+ "name": "SignatureVerificationFailedInvalidData",
936
+ "msg": "Signature verification failed: invalid data"
937
+ },
938
+ {
939
+ "code": 6026,
940
+ "name": "InvalidSwapDataPayIn",
941
+ "msg": "Invalid swap data: pay in"
942
+ },
943
+ {
944
+ "code": 6027,
945
+ "name": "InvalidSwapDataNonce",
946
+ "msg": "Invalid swap data: nonce"
947
+ }
948
+ ]
949
+ };
950
+
951
+ export const IDL: SwapProgramV2 = {
952
+ "version": "0.2.0",
953
+ "name": "swap_program",
954
+ "instructions": [
955
+ {
956
+ "name": "deposit",
957
+ "accounts": [
958
+ {
959
+ "name": "signer",
960
+ "isMut": true,
961
+ "isSigner": true
962
+ },
963
+ {
964
+ "name": "signerAta",
965
+ "isMut": true,
966
+ "isSigner": false
967
+ },
968
+ {
969
+ "name": "userData",
970
+ "isMut": true,
971
+ "isSigner": false
972
+ },
973
+ {
974
+ "name": "vault",
975
+ "isMut": true,
976
+ "isSigner": false
977
+ },
978
+ {
979
+ "name": "mint",
980
+ "isMut": false,
981
+ "isSigner": false
982
+ },
983
+ {
984
+ "name": "systemProgram",
985
+ "isMut": false,
986
+ "isSigner": false
987
+ },
988
+ {
989
+ "name": "tokenProgram",
990
+ "isMut": false,
991
+ "isSigner": false
992
+ }
993
+ ],
994
+ "args": [
995
+ {
996
+ "name": "amount",
997
+ "type": "u64"
998
+ }
999
+ ]
1000
+ },
1001
+ {
1002
+ "name": "withdraw",
1003
+ "accounts": [
1004
+ {
1005
+ "name": "signer",
1006
+ "isMut": true,
1007
+ "isSigner": true
1008
+ },
1009
+ {
1010
+ "name": "signerAta",
1011
+ "isMut": true,
1012
+ "isSigner": false
1013
+ },
1014
+ {
1015
+ "name": "userData",
1016
+ "isMut": true,
1017
+ "isSigner": false
1018
+ },
1019
+ {
1020
+ "name": "vault",
1021
+ "isMut": true,
1022
+ "isSigner": false
1023
+ },
1024
+ {
1025
+ "name": "mint",
1026
+ "isMut": false,
1027
+ "isSigner": false
1028
+ },
1029
+ {
1030
+ "name": "tokenProgram",
1031
+ "isMut": false,
1032
+ "isSigner": false
1033
+ }
1034
+ ],
1035
+ "args": [
1036
+ {
1037
+ "name": "amount",
1038
+ "type": "u64"
1039
+ }
1040
+ ]
1041
+ },
1042
+ {
1043
+ "name": "offererInitializePayIn",
1044
+ "accounts": [
1045
+ {
1046
+ "name": "offerer",
1047
+ "isMut": false,
1048
+ "isSigner": true
1049
+ },
1050
+ {
1051
+ "name": "claimer",
1052
+ "isMut": false,
1053
+ "isSigner": false
1054
+ },
1055
+ {
1056
+ "name": "initializer",
1057
+ "isMut": true,
1058
+ "isSigner": true
1059
+ },
1060
+ {
1061
+ "name": "offererAta",
1062
+ "isMut": true,
1063
+ "isSigner": false
1064
+ },
1065
+ {
1066
+ "name": "escrowState",
1067
+ "isMut": true,
1068
+ "isSigner": false
1069
+ },
1070
+ {
1071
+ "name": "vault",
1072
+ "isMut": true,
1073
+ "isSigner": false
1074
+ },
1075
+ {
1076
+ "name": "mint",
1077
+ "isMut": false,
1078
+ "isSigner": false
1079
+ },
1080
+ {
1081
+ "name": "systemProgram",
1082
+ "isMut": false,
1083
+ "isSigner": false
1084
+ },
1085
+ {
1086
+ "name": "tokenProgram",
1087
+ "isMut": false,
1088
+ "isSigner": false
1089
+ },
1090
+ {
1091
+ "name": "claimerUserData",
1092
+ "isMut": false,
1093
+ "isSigner": false,
1094
+ "isOptional": true
1095
+ },
1096
+ {
1097
+ "name": "claimerAta",
1098
+ "isMut": false,
1099
+ "isSigner": false,
1100
+ "isOptional": true
1101
+ }
1102
+ ],
1103
+ "args": [
1104
+ {
1105
+ "name": "swapData",
1106
+ "type": {
1107
+ "defined": "SwapData"
1108
+ }
1109
+ },
1110
+ {
1111
+ "name": "securityDeposit",
1112
+ "type": "u64"
1113
+ },
1114
+ {
1115
+ "name": "claimerBounty",
1116
+ "type": "u64"
1117
+ },
1118
+ {
1119
+ "name": "txoHash",
1120
+ "type": {
1121
+ "array": [
1122
+ "u8",
1123
+ 32
1124
+ ]
1125
+ }
1126
+ },
1127
+ {
1128
+ "name": "authExpiry",
1129
+ "type": "u64"
1130
+ }
1131
+ ]
1132
+ },
1133
+ {
1134
+ "name": "offererInitialize",
1135
+ "accounts": [
1136
+ {
1137
+ "name": "offerer",
1138
+ "isMut": false,
1139
+ "isSigner": true
1140
+ },
1141
+ {
1142
+ "name": "claimer",
1143
+ "isMut": false,
1144
+ "isSigner": false
1145
+ },
1146
+ {
1147
+ "name": "initializer",
1148
+ "isMut": true,
1149
+ "isSigner": true
1150
+ },
1151
+ {
1152
+ "name": "offererUserData",
1153
+ "isMut": true,
1154
+ "isSigner": false
1155
+ },
1156
+ {
1157
+ "name": "escrowState",
1158
+ "isMut": true,
1159
+ "isSigner": false
1160
+ },
1161
+ {
1162
+ "name": "mint",
1163
+ "isMut": false,
1164
+ "isSigner": false
1165
+ },
1166
+ {
1167
+ "name": "systemProgram",
1168
+ "isMut": false,
1169
+ "isSigner": false
1170
+ },
1171
+ {
1172
+ "name": "claimerUserData",
1173
+ "isMut": false,
1174
+ "isSigner": false,
1175
+ "isOptional": true
1176
+ },
1177
+ {
1178
+ "name": "claimerAta",
1179
+ "isMut": false,
1180
+ "isSigner": false,
1181
+ "isOptional": true
1182
+ }
1183
+ ],
1184
+ "args": [
1185
+ {
1186
+ "name": "swapData",
1187
+ "type": {
1188
+ "defined": "SwapData"
1189
+ }
1190
+ },
1191
+ {
1192
+ "name": "securityDeposit",
1193
+ "type": "u64"
1194
+ },
1195
+ {
1196
+ "name": "claimerBounty",
1197
+ "type": "u64"
1198
+ },
1199
+ {
1200
+ "name": "txoHash",
1201
+ "type": {
1202
+ "array": [
1203
+ "u8",
1204
+ 32
1205
+ ]
1206
+ }
1207
+ },
1208
+ {
1209
+ "name": "authExpiry",
1210
+ "type": "u64"
1211
+ }
1212
+ ]
1213
+ },
1214
+ {
1215
+ "name": "offererRefund",
1216
+ "accounts": [
1217
+ {
1218
+ "name": "offerer",
1219
+ "isMut": true,
1220
+ "isSigner": false
1221
+ },
1222
+ {
1223
+ "name": "claimer",
1224
+ "isMut": true,
1225
+ "isSigner": false
1226
+ },
1227
+ {
1228
+ "name": "escrowState",
1229
+ "isMut": true,
1230
+ "isSigner": false
1231
+ },
1232
+ {
1233
+ "name": "offererUserData",
1234
+ "isMut": true,
1235
+ "isSigner": false
1236
+ },
1237
+ {
1238
+ "name": "claimerUserData",
1239
+ "isMut": true,
1240
+ "isSigner": false,
1241
+ "isOptional": true
1242
+ },
1243
+ {
1244
+ "name": "ixSysvar",
1245
+ "isMut": false,
1246
+ "isSigner": false,
1247
+ "isOptional": true
1248
+ }
1249
+ ],
1250
+ "args": [
1251
+ {
1252
+ "name": "authExpiry",
1253
+ "type": "u64"
1254
+ }
1255
+ ]
1256
+ },
1257
+ {
1258
+ "name": "offererRefundPayIn",
1259
+ "accounts": [
1260
+ {
1261
+ "name": "offerer",
1262
+ "isMut": true,
1263
+ "isSigner": false
1264
+ },
1265
+ {
1266
+ "name": "claimer",
1267
+ "isMut": true,
1268
+ "isSigner": false
1269
+ },
1270
+ {
1271
+ "name": "offererAta",
1272
+ "isMut": true,
1273
+ "isSigner": false
1274
+ },
1275
+ {
1276
+ "name": "escrowState",
1277
+ "isMut": true,
1278
+ "isSigner": false
1279
+ },
1280
+ {
1281
+ "name": "vault",
1282
+ "isMut": true,
1283
+ "isSigner": false
1284
+ },
1285
+ {
1286
+ "name": "tokenProgram",
1287
+ "isMut": false,
1288
+ "isSigner": false
1289
+ },
1290
+ {
1291
+ "name": "claimerUserData",
1292
+ "isMut": true,
1293
+ "isSigner": false,
1294
+ "isOptional": true
1295
+ },
1296
+ {
1297
+ "name": "ixSysvar",
1298
+ "isMut": false,
1299
+ "isSigner": false,
1300
+ "isOptional": true
1301
+ }
1302
+ ],
1303
+ "args": [
1304
+ {
1305
+ "name": "authExpiry",
1306
+ "type": "u64"
1307
+ }
1308
+ ]
1309
+ },
1310
+ {
1311
+ "name": "claimerClaim",
1312
+ "accounts": [
1313
+ {
1314
+ "name": "signer",
1315
+ "isMut": true,
1316
+ "isSigner": true
1317
+ },
1318
+ {
1319
+ "name": "offerer",
1320
+ "isMut": true,
1321
+ "isSigner": false
1322
+ },
1323
+ {
1324
+ "name": "claimer",
1325
+ "isMut": true,
1326
+ "isSigner": false
1327
+ },
1328
+ {
1329
+ "name": "escrowState",
1330
+ "isMut": true,
1331
+ "isSigner": false
1332
+ },
1333
+ {
1334
+ "name": "ixSysvar",
1335
+ "isMut": false,
1336
+ "isSigner": false
1337
+ },
1338
+ {
1339
+ "name": "claimerUserData",
1340
+ "isMut": true,
1341
+ "isSigner": false
1342
+ },
1343
+ {
1344
+ "name": "data",
1345
+ "isMut": true,
1346
+ "isSigner": false,
1347
+ "isOptional": true
1348
+ }
1349
+ ],
1350
+ "args": [
1351
+ {
1352
+ "name": "secret",
1353
+ "type": "bytes"
1354
+ }
1355
+ ]
1356
+ },
1357
+ {
1358
+ "name": "claimerClaimPayOut",
1359
+ "accounts": [
1360
+ {
1361
+ "name": "signer",
1362
+ "isMut": true,
1363
+ "isSigner": true
1364
+ },
1365
+ {
1366
+ "name": "offerer",
1367
+ "isMut": true,
1368
+ "isSigner": false
1369
+ },
1370
+ {
1371
+ "name": "claimer",
1372
+ "isMut": true,
1373
+ "isSigner": false
1374
+ },
1375
+ {
1376
+ "name": "escrowState",
1377
+ "isMut": true,
1378
+ "isSigner": false
1379
+ },
1380
+ {
1381
+ "name": "ixSysvar",
1382
+ "isMut": false,
1383
+ "isSigner": false
1384
+ },
1385
+ {
1386
+ "name": "claimerAta",
1387
+ "isMut": true,
1388
+ "isSigner": false
1389
+ },
1390
+ {
1391
+ "name": "vault",
1392
+ "isMut": true,
1393
+ "isSigner": false
1394
+ },
1395
+ {
1396
+ "name": "tokenProgram",
1397
+ "isMut": false,
1398
+ "isSigner": false
1399
+ },
1400
+ {
1401
+ "name": "data",
1402
+ "isMut": true,
1403
+ "isSigner": false,
1404
+ "isOptional": true
1405
+ }
1406
+ ],
1407
+ "args": [
1408
+ {
1409
+ "name": "secret",
1410
+ "type": "bytes"
1411
+ }
1412
+ ]
1413
+ },
1414
+ {
1415
+ "name": "initData",
1416
+ "accounts": [
1417
+ {
1418
+ "name": "signer",
1419
+ "isMut": true,
1420
+ "isSigner": true
1421
+ },
1422
+ {
1423
+ "name": "data",
1424
+ "isMut": true,
1425
+ "isSigner": true
1426
+ }
1427
+ ],
1428
+ "args": []
1429
+ },
1430
+ {
1431
+ "name": "writeData",
1432
+ "accounts": [
1433
+ {
1434
+ "name": "signer",
1435
+ "isMut": true,
1436
+ "isSigner": true
1437
+ },
1438
+ {
1439
+ "name": "data",
1440
+ "isMut": true,
1441
+ "isSigner": false
1442
+ }
1443
+ ],
1444
+ "args": [
1445
+ {
1446
+ "name": "start",
1447
+ "type": "u32"
1448
+ },
1449
+ {
1450
+ "name": "data",
1451
+ "type": "bytes"
1452
+ }
1453
+ ]
1454
+ },
1455
+ {
1456
+ "name": "closeData",
1457
+ "accounts": [
1458
+ {
1459
+ "name": "signer",
1460
+ "isMut": true,
1461
+ "isSigner": true
1462
+ },
1463
+ {
1464
+ "name": "data",
1465
+ "isMut": true,
1466
+ "isSigner": false
1467
+ }
1468
+ ],
1469
+ "args": []
1470
+ }
1471
+ ],
1472
+ "accounts": [
1473
+ {
1474
+ "name": "escrowState",
1475
+ "type": {
1476
+ "kind": "struct",
1477
+ "fields": [
1478
+ {
1479
+ "name": "data",
1480
+ "type": {
1481
+ "defined": "SwapData"
1482
+ }
1483
+ },
1484
+ {
1485
+ "name": "offerer",
1486
+ "type": "publicKey"
1487
+ },
1488
+ {
1489
+ "name": "offererAta",
1490
+ "type": "publicKey"
1491
+ },
1492
+ {
1493
+ "name": "claimer",
1494
+ "type": "publicKey"
1495
+ },
1496
+ {
1497
+ "name": "claimerAta",
1498
+ "type": "publicKey"
1499
+ },
1500
+ {
1501
+ "name": "mint",
1502
+ "type": "publicKey"
1503
+ },
1504
+ {
1505
+ "name": "claimerBounty",
1506
+ "type": "u64"
1507
+ },
1508
+ {
1509
+ "name": "securityDeposit",
1510
+ "type": "u64"
1511
+ },
1512
+ {
1513
+ "name": "offererInitializer",
1514
+ "type": "bool"
1515
+ }
1516
+ ]
1517
+ }
1518
+ },
1519
+ {
1520
+ "name": "userAccount",
1521
+ "type": {
1522
+ "kind": "struct",
1523
+ "fields": [
1524
+ {
1525
+ "name": "amount",
1526
+ "type": "u64"
1527
+ },
1528
+ {
1529
+ "name": "successVolume",
1530
+ "type": {
1531
+ "array": [
1532
+ "u64",
1533
+ 4
1534
+ ]
1535
+ }
1536
+ },
1537
+ {
1538
+ "name": "successCount",
1539
+ "type": {
1540
+ "array": [
1541
+ "u64",
1542
+ 4
1543
+ ]
1544
+ }
1545
+ },
1546
+ {
1547
+ "name": "failVolume",
1548
+ "type": {
1549
+ "array": [
1550
+ "u64",
1551
+ 4
1552
+ ]
1553
+ }
1554
+ },
1555
+ {
1556
+ "name": "failCount",
1557
+ "type": {
1558
+ "array": [
1559
+ "u64",
1560
+ 4
1561
+ ]
1562
+ }
1563
+ },
1564
+ {
1565
+ "name": "coopCloseVolume",
1566
+ "type": {
1567
+ "array": [
1568
+ "u64",
1569
+ 4
1570
+ ]
1571
+ }
1572
+ },
1573
+ {
1574
+ "name": "coopCloseCount",
1575
+ "type": {
1576
+ "array": [
1577
+ "u64",
1578
+ 4
1579
+ ]
1580
+ }
1581
+ },
1582
+ {
1583
+ "name": "bump",
1584
+ "type": "u8"
1585
+ }
1586
+ ]
1587
+ }
1588
+ }
1589
+ ],
1590
+ "types": [
1591
+ {
1592
+ "name": "SwapData",
1593
+ "type": {
1594
+ "kind": "struct",
1595
+ "fields": [
1596
+ {
1597
+ "name": "kind",
1598
+ "type": {
1599
+ "defined": "SwapType"
1600
+ }
1601
+ },
1602
+ {
1603
+ "name": "confirmations",
1604
+ "type": "u16"
1605
+ },
1606
+ {
1607
+ "name": "nonce",
1608
+ "type": "u64"
1609
+ },
1610
+ {
1611
+ "name": "hash",
1612
+ "type": {
1613
+ "array": [
1614
+ "u8",
1615
+ 32
1616
+ ]
1617
+ }
1618
+ },
1619
+ {
1620
+ "name": "payIn",
1621
+ "type": "bool"
1622
+ },
1623
+ {
1624
+ "name": "payOut",
1625
+ "type": "bool"
1626
+ },
1627
+ {
1628
+ "name": "amount",
1629
+ "type": "u64"
1630
+ },
1631
+ {
1632
+ "name": "expiry",
1633
+ "type": "u64"
1634
+ },
1635
+ {
1636
+ "name": "sequence",
1637
+ "type": "u64"
1638
+ }
1639
+ ]
1640
+ }
1641
+ },
1642
+ {
1643
+ "name": "SwapType",
1644
+ "type": {
1645
+ "kind": "enum",
1646
+ "variants": [
1647
+ {
1648
+ "name": "Htlc"
1649
+ },
1650
+ {
1651
+ "name": "Chain"
1652
+ },
1653
+ {
1654
+ "name": "ChainNonced"
1655
+ },
1656
+ {
1657
+ "name": "ChainTxhash"
1658
+ }
1659
+ ]
1660
+ }
1661
+ }
1662
+ ],
1663
+ "events": [
1664
+ {
1665
+ "name": "InitializeEvent",
1666
+ "fields": [
1667
+ {
1668
+ "name": "hash",
1669
+ "type": {
1670
+ "array": [
1671
+ "u8",
1672
+ 32
1673
+ ]
1674
+ },
1675
+ "index": false
1676
+ },
1677
+ {
1678
+ "name": "txoHash",
1679
+ "type": {
1680
+ "array": [
1681
+ "u8",
1682
+ 32
1683
+ ]
1684
+ },
1685
+ "index": false
1686
+ },
1687
+ {
1688
+ "name": "nonce",
1689
+ "type": "u64",
1690
+ "index": false
1691
+ },
1692
+ {
1693
+ "name": "kind",
1694
+ "type": {
1695
+ "defined": "SwapType"
1696
+ },
1697
+ "index": false
1698
+ },
1699
+ {
1700
+ "name": "sequence",
1701
+ "type": "u64",
1702
+ "index": false
1703
+ }
1704
+ ]
1705
+ },
1706
+ {
1707
+ "name": "RefundEvent",
1708
+ "fields": [
1709
+ {
1710
+ "name": "hash",
1711
+ "type": {
1712
+ "array": [
1713
+ "u8",
1714
+ 32
1715
+ ]
1716
+ },
1717
+ "index": false
1718
+ },
1719
+ {
1720
+ "name": "sequence",
1721
+ "type": "u64",
1722
+ "index": false
1723
+ }
1724
+ ]
1725
+ },
1726
+ {
1727
+ "name": "ClaimEvent",
1728
+ "fields": [
1729
+ {
1730
+ "name": "hash",
1731
+ "type": {
1732
+ "array": [
1733
+ "u8",
1734
+ 32
1735
+ ]
1736
+ },
1737
+ "index": false
1738
+ },
1739
+ {
1740
+ "name": "secret",
1741
+ "type": {
1742
+ "array": [
1743
+ "u8",
1744
+ 32
1745
+ ]
1746
+ },
1747
+ "index": false
1748
+ },
1749
+ {
1750
+ "name": "sequence",
1751
+ "type": "u64",
1752
+ "index": false
1753
+ }
1754
+ ]
1755
+ }
1756
+ ],
1757
+ "errors": [
1758
+ {
1759
+ "code": 6000,
1760
+ "name": "AuthExpired",
1761
+ "msg": "Authorization expired."
1762
+ },
1763
+ {
1764
+ "code": 6001,
1765
+ "name": "NotExpiredYet",
1766
+ "msg": "Request not expired yet."
1767
+ },
1768
+ {
1769
+ "code": 6002,
1770
+ "name": "AlreadyExpired",
1771
+ "msg": "Request already expired."
1772
+ },
1773
+ {
1774
+ "code": 6003,
1775
+ "name": "InvalidSecret",
1776
+ "msg": "Invalid secret provided."
1777
+ },
1778
+ {
1779
+ "code": 6004,
1780
+ "name": "InsufficientFunds",
1781
+ "msg": "Not enough funds."
1782
+ },
1783
+ {
1784
+ "code": 6005,
1785
+ "name": "KindUnknown",
1786
+ "msg": "Unknown type of the contract."
1787
+ },
1788
+ {
1789
+ "code": 6006,
1790
+ "name": "TooManyConfirmations",
1791
+ "msg": "Too many confirmations required."
1792
+ },
1793
+ {
1794
+ "code": 6007,
1795
+ "name": "InvalidTxVerifyProgramId",
1796
+ "msg": "Invalid program id for transaction verification."
1797
+ },
1798
+ {
1799
+ "code": 6008,
1800
+ "name": "InvalidTxVerifyIx",
1801
+ "msg": "Invalid instruction for transaction verification."
1802
+ },
1803
+ {
1804
+ "code": 6009,
1805
+ "name": "InvalidTxVerifyTxid",
1806
+ "msg": "Invalid txid for transaction verification."
1807
+ },
1808
+ {
1809
+ "code": 6010,
1810
+ "name": "InvalidTxVerifyConfirmations",
1811
+ "msg": "Invalid confirmations for transaction verification."
1812
+ },
1813
+ {
1814
+ "code": 6011,
1815
+ "name": "InvalidTx",
1816
+ "msg": "Invalid transaction/nSequence"
1817
+ },
1818
+ {
1819
+ "code": 6012,
1820
+ "name": "InvalidNonce",
1821
+ "msg": "Invalid nonce used"
1822
+ },
1823
+ {
1824
+ "code": 6013,
1825
+ "name": "InvalidVout",
1826
+ "msg": "Invalid vout of the output used"
1827
+ },
1828
+ {
1829
+ "code": 6014,
1830
+ "name": "InvalidAccountWritability",
1831
+ "msg": "Account cannot be written to"
1832
+ },
1833
+ {
1834
+ "code": 6015,
1835
+ "name": "InvalidDataAccount",
1836
+ "msg": "Invalid data account"
1837
+ },
1838
+ {
1839
+ "code": 6016,
1840
+ "name": "InvalidUserData",
1841
+ "msg": "Invalid user data account"
1842
+ },
1843
+ {
1844
+ "code": 6017,
1845
+ "name": "InvalidBlockheightVerifyProgramId",
1846
+ "msg": "Invalid program id for blockheight verification."
1847
+ },
1848
+ {
1849
+ "code": 6018,
1850
+ "name": "InvalidBlockheightVerifyIx",
1851
+ "msg": "Invalid instruction for blockheight verification."
1852
+ },
1853
+ {
1854
+ "code": 6019,
1855
+ "name": "InvalidBlockheightVerifyHeight",
1856
+ "msg": "Invalid height for blockheight verification."
1857
+ },
1858
+ {
1859
+ "code": 6020,
1860
+ "name": "InvalidBlockheightVerifyOperation",
1861
+ "msg": "Invalid operation for blockheight verification."
1862
+ },
1863
+ {
1864
+ "code": 6021,
1865
+ "name": "SignatureVerificationFailedInvalidProgram",
1866
+ "msg": "Signature verification failed: invalid ed25519 program id"
1867
+ },
1868
+ {
1869
+ "code": 6022,
1870
+ "name": "SignatureVerificationFailedAccountsLength",
1871
+ "msg": "Signature verification failed: invalid accounts length"
1872
+ },
1873
+ {
1874
+ "code": 6023,
1875
+ "name": "SignatureVerificationFailedDataLength",
1876
+ "msg": "Signature verification failed: invalid data length"
1877
+ },
1878
+ {
1879
+ "code": 6024,
1880
+ "name": "SignatureVerificationFailedInvalidHeader",
1881
+ "msg": "Signature verification failed: invalid header"
1882
+ },
1883
+ {
1884
+ "code": 6025,
1885
+ "name": "SignatureVerificationFailedInvalidData",
1886
+ "msg": "Signature verification failed: invalid data"
1887
+ },
1888
+ {
1889
+ "code": 6026,
1890
+ "name": "InvalidSwapDataPayIn",
1891
+ "msg": "Invalid swap data: pay in"
1892
+ },
1893
+ {
1894
+ "code": 6027,
1895
+ "name": "InvalidSwapDataNonce",
1896
+ "msg": "Invalid swap data: nonce"
1897
+ }
1898
+ ]
1899
+ };