@n1xyz/nord-ts 0.0.14 → 0.0.16-29f6652

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 (186) hide show
  1. package/.prettierignore +1 -0
  2. package/README.md +9 -6
  3. package/dist/bridge/client.d.ts +8 -7
  4. package/dist/bridge/client.js +39 -37
  5. package/dist/bridge/index.d.ts +1 -2
  6. package/dist/bridge/index.js +2 -2
  7. package/dist/bridge/types.d.ts +7 -3
  8. package/dist/bridge/types.js +3 -1
  9. package/dist/gen/common.js +1 -1
  10. package/dist/gen/nord.d.ts +74 -25
  11. package/dist/gen/nord.js +498 -78
  12. package/dist/idl/bridge.json +1493 -0
  13. package/dist/idl/index.d.ts +585 -0
  14. package/dist/idl/index.js +8 -0
  15. package/dist/nord/api/core.js +7 -5
  16. package/dist/nord/api/metrics.js +7 -4
  17. package/dist/nord/client/Nord.d.ts +19 -5
  18. package/dist/nord/client/Nord.js +50 -23
  19. package/dist/nord/client/NordUser.d.ts +1 -1
  20. package/dist/nord/client/NordUser.js +19 -16
  21. package/dist/types.d.ts +3 -3
  22. package/dist/websocket/NordWebSocketClient.js +0 -2
  23. package/docs/assets/hierarchy.js +1 -1
  24. package/docs/assets/navigation.js +1 -1
  25. package/docs/assets/search.js +1 -1
  26. package/docs/classes/Nord.html +99 -100
  27. package/docs/classes/NordError.html +6 -6
  28. package/docs/classes/NordUser.html +49 -54
  29. package/docs/classes/NordWebSocketClient.html +6 -11
  30. package/docs/classes/SolanaBridgeClient.html +32 -27
  31. package/docs/classes/Subscriber.html +3 -3
  32. package/docs/enums/FillMode.html +2 -2
  33. package/docs/enums/KeyType.html +2 -2
  34. package/docs/enums/MetricPeriod.html +2 -2
  35. package/docs/enums/PdaSeedType.html +5 -3
  36. package/docs/enums/PeakTpsPeriodUnit.html +2 -2
  37. package/docs/enums/Side.html +2 -2
  38. package/docs/enums/WebSocketMessageType.html +3 -3
  39. package/docs/functions/actionQueryRollman.html +1 -1
  40. package/docs/functions/actionsQueryRollman.html +1 -1
  41. package/docs/functions/aggregateMetrics-1.html +1 -1
  42. package/docs/functions/assert.html +1 -1
  43. package/docs/functions/bigIntToProtoU128.html +1 -1
  44. package/docs/functions/bridgeToBN.html +1 -1
  45. package/docs/functions/bufferToHex.html +1 -1
  46. package/docs/functions/cancelOrder.html +1 -1
  47. package/docs/functions/checkPubKeyLength.html +1 -1
  48. package/docs/functions/checkedFetch.html +1 -1
  49. package/docs/functions/createSession.html +1 -1
  50. package/docs/functions/decodeLengthDelimited.html +1 -1
  51. package/docs/functions/encodeLengthDelimited.html +1 -1
  52. package/docs/functions/fillModeToProtoFillMode.html +1 -1
  53. package/docs/functions/findMarket.html +1 -1
  54. package/docs/functions/findPda.html +1 -1
  55. package/docs/functions/findToken.html +1 -1
  56. package/docs/functions/fromBN.html +1 -1
  57. package/docs/functions/getAccount.html +1 -1
  58. package/docs/functions/getActionNonce.html +1 -1
  59. package/docs/functions/getCurrentTps.html +1 -1
  60. package/docs/functions/getInfo.html +1 -1
  61. package/docs/functions/{queryLastNBlocks.html → getLastActionId.html} +3 -3
  62. package/docs/functions/getMedianLatency.html +1 -1
  63. package/docs/functions/getOrderbook.html +1 -1
  64. package/docs/functions/getPeakTps.html +1 -1
  65. package/docs/functions/getTimestamp.html +1 -1
  66. package/docs/functions/getTotalTransactions.html +1 -1
  67. package/docs/functions/getTrades.html +1 -1
  68. package/docs/functions/getUserAccountIds.html +1 -1
  69. package/docs/functions/hexToBuffer.html +1 -1
  70. package/docs/functions/initWebSocketClient.html +9 -9
  71. package/docs/functions/keypairFromPrivateKey.html +1 -1
  72. package/docs/functions/makeSigningFunction.html +1 -1
  73. package/docs/functions/makeWalletSignFn.html +1 -1
  74. package/docs/functions/marketsStats.html +1 -1
  75. package/docs/functions/optExpect.html +1 -1
  76. package/docs/functions/optMap.html +1 -1
  77. package/docs/functions/optUnwrap.html +1 -1
  78. package/docs/functions/panic.html +1 -1
  79. package/docs/functions/placeOrder.html +1 -1
  80. package/docs/functions/queryAction.html +1 -1
  81. package/docs/functions/queryPrometheus.html +1 -1
  82. package/docs/functions/queryRecentActions.html +4 -3
  83. package/docs/functions/revokeSession.html +1 -1
  84. package/docs/functions/shortenPublicKey.html +1 -1
  85. package/docs/functions/signAction.html +1 -1
  86. package/docs/functions/toBN.html +1 -1
  87. package/docs/functions/toScaledU128.html +1 -1
  88. package/docs/functions/toScaledU64.html +1 -1
  89. package/docs/functions/transfer.html +1 -1
  90. package/docs/functions/withdraw.html +1 -1
  91. package/docs/hierarchy.html +1 -1
  92. package/docs/index.html +2 -2
  93. package/docs/interfaces/Account.html +2 -2
  94. package/docs/interfaces/ActionInfo.html +2 -2
  95. package/docs/interfaces/ActionNonceResponse.html +2 -2
  96. package/docs/interfaces/ActionQuery.html +2 -2
  97. package/docs/interfaces/ActionResponse.html +2 -2
  98. package/docs/interfaces/ActionsExtendedInfo.html +2 -2
  99. package/docs/interfaces/ActionsQuery.html +2 -2
  100. package/docs/interfaces/ActionsResponse.html +2 -2
  101. package/docs/interfaces/AggregateMetrics.html +2 -2
  102. package/docs/interfaces/BlockFacts.html +5 -5
  103. package/docs/interfaces/BlockQuery.html +2 -2
  104. package/docs/interfaces/BlockResponse.html +2 -2
  105. package/docs/interfaces/BlockSummary.html +2 -2
  106. package/docs/interfaces/BlockSummaryResponse.html +2 -2
  107. package/docs/interfaces/DeltaEvent.html +2 -2
  108. package/docs/interfaces/DepositSplParams.html +6 -6
  109. package/docs/interfaces/Info.html +2 -2
  110. package/docs/interfaces/Market.html +2 -2
  111. package/docs/interfaces/MarketStats.html +2 -2
  112. package/docs/interfaces/MarketsStatsResponse.html +2 -2
  113. package/docs/interfaces/NordConfig.html +19 -9
  114. package/docs/interfaces/NordWebSocketClientEvents.html +2 -2
  115. package/docs/interfaces/NordWebSocketEvents.html +3 -3
  116. package/docs/interfaces/Order.html +2 -2
  117. package/docs/interfaces/OrderInfo.html +2 -2
  118. package/docs/interfaces/OrderbookEntry.html +2 -2
  119. package/docs/interfaces/OrderbookQuery.html +2 -2
  120. package/docs/interfaces/OrderbookResponse.html +2 -2
  121. package/docs/interfaces/OrderbookSubscription.html +5 -5
  122. package/docs/interfaces/PerpMarketStats.html +2 -2
  123. package/docs/interfaces/RollmanActionExtendedInfo.html +2 -2
  124. package/docs/interfaces/RollmanActionInfo.html +2 -2
  125. package/docs/interfaces/RollmanActionResponse.html +2 -2
  126. package/docs/interfaces/RollmanActionsResponse.html +2 -2
  127. package/docs/interfaces/RollmanBlockResponse.html +2 -2
  128. package/docs/interfaces/SPLTokenInfo.html +5 -5
  129. package/docs/interfaces/SolanaBridgeConfig.html +8 -6
  130. package/docs/interfaces/StateFacts.html +5 -5
  131. package/docs/interfaces/SubscriberConfig.html +2 -2
  132. package/docs/interfaces/TimestampResponse.html +2 -2
  133. package/docs/interfaces/Token.html +2 -2
  134. package/docs/interfaces/TokenInfo.html +3 -2
  135. package/docs/interfaces/Trade.html +2 -2
  136. package/docs/interfaces/TradeSubscription.html +5 -5
  137. package/docs/interfaces/Trades.html +2 -2
  138. package/docs/interfaces/TradesQuery.html +2 -2
  139. package/docs/interfaces/TradesResponse.html +2 -2
  140. package/docs/interfaces/TransferParams.html +4 -4
  141. package/docs/interfaces/UserAccountIdsQuery.html +2 -2
  142. package/docs/interfaces/UserAccountIdsResponse.html +2 -2
  143. package/docs/interfaces/WebSocketAccountUpdate.html +6 -0
  144. package/docs/interfaces/WebSocketDeltaUpdate.html +3 -3
  145. package/docs/interfaces/WebSocketSubscription.html +3 -3
  146. package/docs/interfaces/WebSocketTradeUpdate.html +3 -3
  147. package/docs/interfaces/WithdrawalClaim.html +7 -7
  148. package/docs/interfaces/WithdrawalParams.html +4 -4
  149. package/docs/modules.html +1 -1
  150. package/docs/types/BigIntValue.html +1 -1
  151. package/docs/types/SubscriptionPattern.html +4 -0
  152. package/docs/types/SubscriptionType.html +2 -0
  153. package/docs/types/WebSocketMessage.html +1 -1
  154. package/docs/variables/DEBUG_KEYS.html +1 -1
  155. package/docs/variables/DEFAULT_FUNDING_AMOUNTS.html +1 -1
  156. package/docs/variables/DEV_TOKEN_INFOS.html +1 -1
  157. package/docs/variables/DEV_URL.html +1 -1
  158. package/docs/variables/MAX_BUFFER_LEN.html +1 -1
  159. package/docs/variables/SESSION_TTL.html +1 -1
  160. package/docs/variables/WEBSERVER_DEV_URL.html +1 -1
  161. package/docs/variables/ZERO_DECIMAL.html +1 -1
  162. package/docs/variables/_private.html +1 -1
  163. package/idl-generate.sh +4 -0
  164. package/package.json +6 -3
  165. package/src/bridge/client.ts +55 -43
  166. package/src/bridge/index.ts +1 -2
  167. package/src/bridge/types.ts +7 -3
  168. package/src/gen/common.ts +1 -1
  169. package/src/gen/nord.ts +567 -75
  170. package/src/idl/bridge.json +1493 -0
  171. package/src/idl/index.ts +2 -0
  172. package/src/nord/api/core.ts +1 -3
  173. package/src/nord/api/metrics.ts +2 -0
  174. package/src/nord/client/Nord.ts +49 -13
  175. package/src/nord/client/NordUser.ts +52 -59
  176. package/src/types.ts +2 -2
  177. package/src/websocket/NordWebSocketClient.ts +0 -2
  178. package/tsconfig.json +1 -1
  179. package/dist/idl/bridge.d.ts +0 -2
  180. package/dist/idl/bridge.js +0 -930
  181. package/docs/functions/blockQueryRollman.html +0 -6
  182. package/docs/functions/blockSummaryQueryRollman.html +0 -6
  183. package/docs/functions/queryBlock.html +0 -6
  184. package/docs/functions/queryRecentBlocks.html +0 -6
  185. package/docs/interfaces/WebSocketUserUpdate.html +0 -6
  186. package/src/idl/bridge.ts +0 -929
package/src/idl/bridge.ts DELETED
@@ -1,929 +0,0 @@
1
- import { Idl } from "@coral-xyz/anchor";
2
-
3
- export const BRIDGE_IDL: Idl = {
4
- address: "",
5
- metadata: {
6
- name: "bridge",
7
- version: "0.1.0",
8
- spec: "0.1.0",
9
- description: "Created with Anchor",
10
- },
11
- instructions: [
12
- {
13
- name: "deposit_spl",
14
- discriminator: [224, 0, 198, 175, 198, 47, 105, 204],
15
- accounts: [
16
- {
17
- name: "depositor",
18
- writable: true,
19
- signer: true,
20
- },
21
- {
22
- name: "deposit",
23
- writable: true,
24
- },
25
- {
26
- name: "prev_deposit",
27
- optional: true,
28
- pda: {
29
- seeds: [
30
- {
31
- kind: "const",
32
- value: [
33
- 100, 101, 112, 111, 115, 105, 116, 95, 115, 116, 111, 114, 97,
34
- 103, 101,
35
- ],
36
- },
37
- {
38
- kind: "account",
39
- path: "contract_storage.last_deposit_index",
40
- account: "ContractStorage",
41
- },
42
- ],
43
- },
44
- },
45
- {
46
- name: "asset_config",
47
- pda: {
48
- seeds: [
49
- {
50
- kind: "const",
51
- value: [
52
- 97, 115, 115, 101, 116, 95, 99, 111, 110, 102, 105, 103,
53
- ],
54
- },
55
- {
56
- kind: "account",
57
- path: "from_account.mint",
58
- },
59
- ],
60
- },
61
- },
62
- {
63
- name: "contract_storage",
64
- writable: true,
65
- pda: {
66
- seeds: [
67
- {
68
- kind: "const",
69
- value: [
70
- 99, 111, 110, 116, 114, 97, 99, 116, 95, 115, 116, 111, 114,
71
- 97, 103, 101,
72
- ],
73
- },
74
- ],
75
- },
76
- },
77
- {
78
- name: "from_account",
79
- writable: true,
80
- },
81
- {
82
- name: "to_account",
83
- writable: true,
84
- pda: {
85
- seeds: [
86
- {
87
- kind: "const",
88
- value: [
89
- 79, 224, 127, 226, 92, 181, 26, 89, 30, 167, 10, 86, 86, 68,
90
- 128, 20, 156, 34, 76, 69, 18, 76, 98, 233, 62, 41, 163, 58,
91
- 15, 16, 9, 188,
92
- ],
93
- },
94
- {
95
- kind: "account",
96
- path: "token_program",
97
- },
98
- {
99
- kind: "account",
100
- path: "from_account.mint",
101
- },
102
- ],
103
- program: {
104
- kind: "const",
105
- value: [
106
- 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
107
- 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
108
- 219, 233, 248, 89,
109
- ],
110
- },
111
- },
112
- },
113
- {
114
- name: "program",
115
- address: "AAqdriZHrKLurrGRecnCEHKqZLKmq6Q2mFmH26i3ff3r",
116
- },
117
- {
118
- name: "token_program",
119
- },
120
- {
121
- name: "system_program",
122
- address: "11111111111111111111111111111111",
123
- },
124
- ],
125
- args: [
126
- {
127
- name: "amount",
128
- type: "u64",
129
- },
130
- ],
131
- },
132
- {
133
- name: "emit_crumb",
134
- discriminator: [96, 96, 18, 122, 83, 60, 102, 37],
135
- accounts: [
136
- {
137
- name: "contract_storage",
138
- docs: [
139
- "Need a PDA to ensure that only this contract is allowed to",
140
- "call this instruction; the contract storage account is",
141
- "chosen since pretty much every other ix uses it, so this",
142
- "avoids having to introduce a new account.",
143
- ],
144
- signer: true,
145
- pda: {
146
- seeds: [
147
- {
148
- kind: "const",
149
- value: [
150
- 99, 111, 110, 116, 114, 97, 99, 116, 95, 115, 116, 111, 114,
151
- 97, 103, 101,
152
- ],
153
- },
154
- ],
155
- },
156
- },
157
- ],
158
- args: [],
159
- },
160
- {
161
- name: "finalize_block",
162
- discriminator: [63, 101, 92, 132, 135, 251, 98, 177],
163
- accounts: [
164
- {
165
- name: "payer",
166
- writable: true,
167
- signer: true,
168
- },
169
- {
170
- name: "block",
171
- writable: true,
172
- pda: {
173
- seeds: [
174
- {
175
- kind: "const",
176
- value: [
177
- 98, 108, 111, 99, 107, 95, 115, 116, 111, 114, 97, 103, 101,
178
- ],
179
- },
180
- {
181
- kind: "arg",
182
- path: "block_id",
183
- },
184
- ],
185
- },
186
- },
187
- {
188
- name: "contract_storage",
189
- writable: true,
190
- pda: {
191
- seeds: [
192
- {
193
- kind: "const",
194
- value: [
195
- 99, 111, 110, 116, 114, 97, 99, 116, 95, 115, 116, 111, 114,
196
- 97, 103, 101,
197
- ],
198
- },
199
- ],
200
- },
201
- },
202
- {
203
- name: "program",
204
- address: "AAqdriZHrKLurrGRecnCEHKqZLKmq6Q2mFmH26i3ff3r",
205
- },
206
- {
207
- name: "system_program",
208
- address: "11111111111111111111111111111111",
209
- },
210
- ],
211
- args: [
212
- {
213
- name: "state_update_id",
214
- type: "u64",
215
- },
216
- ],
217
- },
218
- {
219
- name: "finalize_da_fact",
220
- discriminator: [6, 135, 30, 141, 5, 246, 223, 58],
221
- accounts: [
222
- {
223
- name: "payer",
224
- writable: true,
225
- signer: true,
226
- },
227
- {
228
- name: "contract_storage",
229
- pda: {
230
- seeds: [
231
- {
232
- kind: "const",
233
- value: [
234
- 99, 111, 110, 116, 114, 97, 99, 116, 95, 115, 116, 111, 114,
235
- 97, 103, 101,
236
- ],
237
- },
238
- ],
239
- },
240
- },
241
- {
242
- name: "fact_state_storage",
243
- writable: true,
244
- pda: {
245
- seeds: [
246
- {
247
- kind: "const",
248
- value: [
249
- 100, 97, 95, 102, 97, 99, 116, 95, 115, 116, 111, 114, 97,
250
- 103, 101,
251
- ],
252
- },
253
- {
254
- kind: "arg",
255
- path: "fact",
256
- },
257
- ],
258
- },
259
- },
260
- {
261
- name: "program",
262
- address: "AAqdriZHrKLurrGRecnCEHKqZLKmq6Q2mFmH26i3ff3r",
263
- },
264
- {
265
- name: "system_program",
266
- address: "11111111111111111111111111111111",
267
- },
268
- ],
269
- args: [
270
- {
271
- name: "fact",
272
- type: {
273
- array: ["u8", 32],
274
- },
275
- },
276
- ],
277
- },
278
- {
279
- name: "initialize",
280
- discriminator: [175, 175, 109, 31, 13, 152, 155, 237],
281
- accounts: [
282
- {
283
- name: "payer",
284
- writable: true,
285
- signer: true,
286
- },
287
- {
288
- name: "program",
289
- signer: true,
290
- address: "AAqdriZHrKLurrGRecnCEHKqZLKmq6Q2mFmH26i3ff3r",
291
- },
292
- {
293
- name: "contract_storage",
294
- writable: true,
295
- pda: {
296
- seeds: [
297
- {
298
- kind: "const",
299
- value: [
300
- 99, 111, 110, 116, 114, 97, 99, 116, 95, 115, 116, 111, 114,
301
- 97, 103, 101,
302
- ],
303
- },
304
- ],
305
- },
306
- },
307
- {
308
- name: "system_program",
309
- address: "11111111111111111111111111111111",
310
- },
311
- ],
312
- args: [
313
- {
314
- name: "operator",
315
- type: "pubkey",
316
- },
317
- {
318
- name: "challenge_period_slots",
319
- type: "u64",
320
- },
321
- {
322
- name: "initial_app_state_commitment",
323
- type: {
324
- array: ["u8", 32],
325
- },
326
- },
327
- ],
328
- },
329
- {
330
- name: "propose_block",
331
- discriminator: [147, 21, 105, 53, 152, 116, 128, 187],
332
- accounts: [
333
- {
334
- name: "operator",
335
- writable: true,
336
- signer: true,
337
- },
338
- {
339
- name: "block",
340
- writable: true,
341
- },
342
- {
343
- name: "last_deposit",
344
- optional: true,
345
- pda: {
346
- seeds: [
347
- {
348
- kind: "const",
349
- value: [
350
- 100, 101, 112, 111, 115, 105, 116, 95, 115, 116, 111, 114, 97,
351
- 103, 101,
352
- ],
353
- },
354
- {
355
- kind: "arg",
356
- path: "facts.next_state_facts.last_deposit_index",
357
- },
358
- ],
359
- },
360
- },
361
- {
362
- name: "da_fact_state",
363
- },
364
- {
365
- name: "contract_storage",
366
- writable: true,
367
- pda: {
368
- seeds: [
369
- {
370
- kind: "const",
371
- value: [
372
- 99, 111, 110, 116, 114, 97, 99, 116, 95, 115, 116, 111, 114,
373
- 97, 103, 101,
374
- ],
375
- },
376
- ],
377
- },
378
- },
379
- {
380
- name: "program",
381
- address: "AAqdriZHrKLurrGRecnCEHKqZLKmq6Q2mFmH26i3ff3r",
382
- },
383
- {
384
- name: "system_program",
385
- address: "11111111111111111111111111111111",
386
- },
387
- ],
388
- args: [
389
- {
390
- name: "facts",
391
- type: {
392
- defined: {
393
- name: "BlockFacts",
394
- },
395
- },
396
- },
397
- ],
398
- },
399
- {
400
- name: "set_min_deposit",
401
- discriminator: [15, 182, 74, 248, 251, 148, 186, 171],
402
- accounts: [
403
- {
404
- name: "operator",
405
- signer: true,
406
- },
407
- {
408
- name: "contract_storage",
409
- pda: {
410
- seeds: [
411
- {
412
- kind: "const",
413
- value: [
414
- 99, 111, 110, 116, 114, 97, 99, 116, 95, 115, 116, 111, 114,
415
- 97, 103, 101,
416
- ],
417
- },
418
- ],
419
- },
420
- },
421
- {
422
- name: "asset_config",
423
- writable: true,
424
- pda: {
425
- seeds: [
426
- {
427
- kind: "const",
428
- value: [
429
- 97, 115, 115, 101, 116, 95, 99, 111, 110, 102, 105, 103,
430
- ],
431
- },
432
- {
433
- kind: "arg",
434
- path: "asset",
435
- },
436
- ],
437
- },
438
- },
439
- {
440
- name: "program",
441
- address: "AAqdriZHrKLurrGRecnCEHKqZLKmq6Q2mFmH26i3ff3r",
442
- },
443
- ],
444
- args: [
445
- {
446
- name: "asset",
447
- type: "pubkey",
448
- },
449
- {
450
- name: "min_deposit",
451
- type: "u64",
452
- },
453
- ],
454
- },
455
- {
456
- name: "whitelist_asset",
457
- discriminator: [113, 64, 172, 191, 33, 33, 57, 18],
458
- accounts: [
459
- {
460
- name: "operator",
461
- writable: true,
462
- signer: true,
463
- },
464
- {
465
- name: "contract_storage",
466
- pda: {
467
- seeds: [
468
- {
469
- kind: "const",
470
- value: [
471
- 99, 111, 110, 116, 114, 97, 99, 116, 95, 115, 116, 111, 114,
472
- 97, 103, 101,
473
- ],
474
- },
475
- ],
476
- },
477
- },
478
- {
479
- name: "asset_config",
480
- writable: true,
481
- pda: {
482
- seeds: [
483
- {
484
- kind: "const",
485
- value: [
486
- 97, 115, 115, 101, 116, 95, 99, 111, 110, 102, 105, 103,
487
- ],
488
- },
489
- {
490
- kind: "arg",
491
- path: "asset",
492
- },
493
- ],
494
- },
495
- },
496
- {
497
- name: "program",
498
- address: "AAqdriZHrKLurrGRecnCEHKqZLKmq6Q2mFmH26i3ff3r",
499
- },
500
- {
501
- name: "system_program",
502
- address: "11111111111111111111111111111111",
503
- },
504
- ],
505
- args: [
506
- {
507
- name: "asset",
508
- type: "pubkey",
509
- },
510
- {
511
- name: "min_deposit",
512
- type: "u64",
513
- },
514
- ],
515
- },
516
- {
517
- name: "withdraw",
518
- discriminator: [183, 18, 70, 156, 148, 109, 161, 34],
519
- accounts: [
520
- {
521
- name: "payer",
522
- writable: true,
523
- signer: true,
524
- },
525
- {
526
- name: "state_update",
527
- pda: {
528
- seeds: [
529
- {
530
- kind: "const",
531
- value: [
532
- 98, 108, 111, 99, 107, 95, 115, 116, 111, 114, 97, 103, 101,
533
- ],
534
- },
535
- {
536
- kind: "arg",
537
- path: "claim.block_id",
538
- },
539
- ],
540
- },
541
- },
542
- {
543
- name: "withdrawal_nullifier",
544
- writable: true,
545
- pda: {
546
- seeds: [
547
- {
548
- kind: "const",
549
- value: [
550
- 119, 105, 116, 104, 100, 114, 97, 119, 97, 108, 95, 110, 117,
551
- 108, 108, 105, 102, 105, 101, 114,
552
- ],
553
- },
554
- {
555
- kind: "arg",
556
- path: "claim.block_id",
557
- },
558
- {
559
- kind: "arg",
560
- path: "claim.leaf_index",
561
- },
562
- ],
563
- },
564
- },
565
- {
566
- name: "from_account",
567
- writable: true,
568
- pda: {
569
- seeds: [
570
- {
571
- kind: "const",
572
- value: [
573
- 79, 224, 127, 226, 92, 181, 26, 89, 30, 167, 10, 86, 86, 68,
574
- 128, 20, 156, 34, 76, 69, 18, 76, 98, 233, 62, 41, 163, 58,
575
- 15, 16, 9, 188,
576
- ],
577
- },
578
- {
579
- kind: "account",
580
- path: "token_program",
581
- },
582
- {
583
- kind: "account",
584
- path: "to_account.mint",
585
- },
586
- ],
587
- program: {
588
- kind: "const",
589
- value: [
590
- 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
591
- 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
592
- 219, 233, 248, 89,
593
- ],
594
- },
595
- },
596
- },
597
- {
598
- name: "to_account",
599
- writable: true,
600
- },
601
- {
602
- name: "authority",
603
- pda: {
604
- seeds: [
605
- {
606
- kind: "const",
607
- value: [97, 117, 116, 104, 111, 114, 105, 116, 121],
608
- },
609
- ],
610
- },
611
- },
612
- {
613
- name: "contract_storage",
614
- pda: {
615
- seeds: [
616
- {
617
- kind: "const",
618
- value: [
619
- 99, 111, 110, 116, 114, 97, 99, 116, 95, 115, 116, 111, 114,
620
- 97, 103, 101,
621
- ],
622
- },
623
- ],
624
- },
625
- },
626
- {
627
- name: "program",
628
- address: "AAqdriZHrKLurrGRecnCEHKqZLKmq6Q2mFmH26i3ff3r",
629
- },
630
- {
631
- name: "token_program",
632
- },
633
- {
634
- name: "system_program",
635
- address: "11111111111111111111111111111111",
636
- },
637
- ],
638
- args: [
639
- {
640
- name: "claim",
641
- type: {
642
- defined: {
643
- name: "WithdrawalClaim",
644
- },
645
- },
646
- },
647
- ],
648
- },
649
- ],
650
- accounts: [
651
- {
652
- name: "AssetConfig",
653
- discriminator: [57, 112, 247, 166, 247, 64, 140, 23],
654
- },
655
- {
656
- name: "Block",
657
- discriminator: [12, 72, 207, 108, 1, 228, 167, 221],
658
- },
659
- {
660
- name: "ContractStorage",
661
- discriminator: [25, 54, 49, 22, 181, 75, 2, 133],
662
- },
663
- {
664
- name: "Deposit",
665
- discriminator: [148, 146, 121, 66, 207, 173, 21, 227],
666
- },
667
- {
668
- name: "FactStateStorage",
669
- discriminator: [98, 222, 3, 112, 154, 244, 201, 242],
670
- },
671
- {
672
- name: "WithdrawalNullifier",
673
- discriminator: [38, 166, 12, 163, 155, 29, 202, 100],
674
- },
675
- ],
676
- types: [
677
- {
678
- name: "AssetConfig",
679
- type: {
680
- kind: "struct",
681
- fields: [
682
- {
683
- name: "min_deposit",
684
- type: "u64",
685
- },
686
- ],
687
- },
688
- },
689
- {
690
- name: "Block",
691
- type: {
692
- kind: "struct",
693
- fields: [
694
- {
695
- name: "facts",
696
- type: {
697
- defined: {
698
- name: "BlockFacts",
699
- },
700
- },
701
- },
702
- {
703
- name: "finalized",
704
- type: "bool",
705
- },
706
- {
707
- name: "slot_proposed",
708
- type: "u64",
709
- },
710
- ],
711
- },
712
- },
713
- {
714
- name: "BlockFacts",
715
- type: {
716
- kind: "struct",
717
- fields: [
718
- {
719
- name: "prev_state_facts",
720
- type: {
721
- defined: {
722
- name: "StateFacts",
723
- },
724
- },
725
- },
726
- {
727
- name: "next_state_facts",
728
- type: {
729
- defined: {
730
- name: "StateFacts",
731
- },
732
- },
733
- },
734
- {
735
- name: "da_commitment",
736
- type: {
737
- array: ["u8", 32],
738
- },
739
- },
740
- {
741
- name: "withdrawal_root",
742
- type: {
743
- array: ["u8", 32],
744
- },
745
- },
746
- ],
747
- },
748
- },
749
- {
750
- name: "ContractStorage",
751
- type: {
752
- kind: "struct",
753
- fields: [
754
- {
755
- name: "operator",
756
- type: "pubkey",
757
- },
758
- {
759
- name: "challenge_period_slots",
760
- type: "u64",
761
- },
762
- {
763
- name: "last_block_id",
764
- type: "u64",
765
- },
766
- {
767
- name: "last_deposit_index",
768
- type: "u64",
769
- },
770
- {
771
- name: "fina_block_id",
772
- type: "u64",
773
- },
774
- {
775
- name: "fina_state_facts",
776
- type: {
777
- defined: {
778
- name: "StateFacts",
779
- },
780
- },
781
- },
782
- ],
783
- },
784
- },
785
- {
786
- name: "Deposit",
787
- type: {
788
- kind: "struct",
789
- fields: [
790
- {
791
- name: "transfer",
792
- type: {
793
- defined: {
794
- name: "TransferParams",
795
- },
796
- },
797
- },
798
- {
799
- name: "prev_deposit_root",
800
- type: {
801
- array: ["u8", 32],
802
- },
803
- },
804
- ],
805
- },
806
- },
807
- {
808
- name: "FactState",
809
- type: {
810
- kind: "enum",
811
- variants: [
812
- {
813
- name: "Pending",
814
- },
815
- {
816
- name: "Finalized",
817
- },
818
- ],
819
- },
820
- },
821
- {
822
- name: "FactStateStorage",
823
- type: {
824
- kind: "struct",
825
- fields: [
826
- {
827
- name: "state",
828
- type: {
829
- defined: {
830
- name: "FactState",
831
- },
832
- },
833
- },
834
- ],
835
- },
836
- },
837
- {
838
- name: "StateFacts",
839
- type: {
840
- kind: "struct",
841
- fields: [
842
- {
843
- name: "app_state_commitment",
844
- type: {
845
- array: ["u8", 32],
846
- },
847
- },
848
- {
849
- name: "deposit_root",
850
- type: {
851
- array: ["u8", 32],
852
- },
853
- },
854
- {
855
- name: "last_deposit_index",
856
- type: "u64",
857
- },
858
- {
859
- name: "last_action_id",
860
- type: "u64",
861
- },
862
- ],
863
- },
864
- },
865
- {
866
- name: "TransferParams",
867
- type: {
868
- kind: "struct",
869
- fields: [
870
- {
871
- name: "user",
872
- type: "pubkey",
873
- },
874
- {
875
- name: "mint",
876
- type: "pubkey",
877
- },
878
- {
879
- name: "amount",
880
- type: "u64",
881
- },
882
- ],
883
- },
884
- },
885
- {
886
- name: "WithdrawalClaim",
887
- type: {
888
- kind: "struct",
889
- fields: [
890
- {
891
- name: "user",
892
- type: "pubkey",
893
- },
894
- {
895
- name: "amount",
896
- type: "u64",
897
- },
898
- {
899
- name: "block_id",
900
- type: "u64",
901
- },
902
- {
903
- name: "proof",
904
- type: {
905
- vec: {
906
- array: ["u8", 32],
907
- },
908
- },
909
- },
910
- {
911
- name: "leaf_index",
912
- type: "u64",
913
- },
914
- {
915
- name: "leaves_count",
916
- type: "u64",
917
- },
918
- ],
919
- },
920
- },
921
- {
922
- name: "WithdrawalNullifier",
923
- type: {
924
- kind: "struct",
925
- fields: [],
926
- },
927
- },
928
- ],
929
- };