@n1xyz/nord-ts 0.0.1 → 0.0.5

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 (260) hide show
  1. package/README.md +148 -65
  2. package/dist/bridge/client.d.ts +150 -0
  3. package/dist/bridge/client.js +394 -0
  4. package/dist/bridge/const.d.ts +23 -0
  5. package/dist/bridge/const.js +47 -0
  6. package/dist/bridge/index.d.ts +5 -0
  7. package/dist/bridge/index.js +23 -0
  8. package/dist/bridge/types.d.ts +118 -0
  9. package/dist/bridge/types.js +16 -0
  10. package/dist/bridge/utils.d.ts +64 -0
  11. package/dist/bridge/utils.js +131 -0
  12. package/dist/const.d.ts +2 -5
  13. package/dist/const.js +2 -6
  14. package/dist/gen/common.d.ts +6 -1
  15. package/dist/gen/common.js +19 -9
  16. package/dist/gen/nord.d.ts +76 -21
  17. package/dist/gen/nord.js +987 -423
  18. package/dist/idl/bridge.d.ts +2 -0
  19. package/dist/idl/bridge.js +703 -0
  20. package/dist/index.d.ts +5 -2
  21. package/dist/index.js +18 -2
  22. package/dist/nord/{actions.d.ts → api/actions.d.ts} +6 -6
  23. package/dist/nord/{actions.js → api/actions.js} +6 -10
  24. package/dist/nord/api/core.d.ts +49 -0
  25. package/dist/nord/api/core.js +121 -0
  26. package/dist/nord/api/market.d.ts +36 -0
  27. package/dist/nord/api/market.js +98 -0
  28. package/dist/nord/api/metrics.d.ts +67 -0
  29. package/dist/nord/api/metrics.js +132 -0
  30. package/dist/nord/api/queries.d.ts +81 -0
  31. package/dist/nord/api/queries.js +187 -0
  32. package/dist/nord/client/Nord.d.ts +335 -0
  33. package/dist/nord/client/Nord.js +532 -0
  34. package/dist/nord/client/NordUser.d.ts +320 -0
  35. package/dist/nord/client/NordUser.js +697 -0
  36. package/dist/nord/index.d.ts +9 -2
  37. package/dist/nord/index.js +30 -6
  38. package/dist/nord/models/Subscriber.d.ts +37 -0
  39. package/dist/nord/models/Subscriber.js +25 -0
  40. package/dist/nord/utils/NordError.d.ts +35 -0
  41. package/dist/nord/utils/NordError.js +46 -0
  42. package/dist/types.d.ts +143 -86
  43. package/dist/types.js +12 -1
  44. package/dist/utils.d.ts +9 -0
  45. package/dist/utils.js +20 -1
  46. package/dist/websocket/NordWebSocketClient.d.ts +71 -0
  47. package/dist/websocket/NordWebSocketClient.js +343 -0
  48. package/dist/websocket/events.d.ts +19 -0
  49. package/dist/websocket/events.js +2 -0
  50. package/dist/websocket/index.d.ts +2 -0
  51. package/dist/websocket/index.js +5 -0
  52. package/docs/assets/hierarchy.js +1 -0
  53. package/docs/assets/highlight.css +16 -16
  54. package/docs/assets/icons.js +17 -14
  55. package/docs/assets/icons.svg +1 -1
  56. package/docs/assets/main.js +5 -4
  57. package/docs/assets/navigation.js +1 -1
  58. package/docs/assets/search.js +1 -1
  59. package/docs/assets/style.css +1423 -1227
  60. package/docs/classes/Nord.html +189 -43
  61. package/docs/classes/NordError.html +24 -0
  62. package/docs/classes/NordUser.html +120 -35
  63. package/docs/classes/NordWebSocketClient.html +335 -0
  64. package/docs/classes/SolanaBridgeClient.html +86 -0
  65. package/docs/classes/Subscriber.html +10 -6
  66. package/docs/enums/FillMode.html +5 -5
  67. package/docs/enums/KeyType.html +4 -4
  68. package/docs/enums/MetricPeriod.html +9 -0
  69. package/docs/enums/PdaSeedType.html +9 -0
  70. package/docs/enums/PeakTpsPeriodUnit.html +7 -7
  71. package/docs/enums/Side.html +3 -3
  72. package/docs/enums/WebSocketMessageType.html +7 -0
  73. package/docs/functions/actionQueryRollman.html +6 -0
  74. package/docs/functions/actionsQueryRollman.html +6 -0
  75. package/docs/functions/aggregateMetrics-1.html +7 -0
  76. package/docs/functions/assert.html +1 -1
  77. package/docs/functions/bigIntToProtoU128.html +3 -3
  78. package/docs/functions/blockQueryRollman.html +6 -0
  79. package/docs/functions/blockSummaryQueryRollman.html +6 -0
  80. package/docs/functions/bridgeToBN.html +5 -0
  81. package/docs/functions/bufferToHex.html +4 -0
  82. package/docs/functions/cancelOrder.html +1 -0
  83. package/docs/functions/checkPubKeyLength.html +1 -1
  84. package/docs/functions/checkedFetch.html +4 -4
  85. package/docs/functions/createSession.html +1 -0
  86. package/docs/functions/decodeLengthDelimited.html +7 -6
  87. package/docs/functions/encodeLengthDelimited.html +4 -4
  88. package/docs/functions/fillModeToProtoFillMode.html +4 -4
  89. package/docs/functions/findMarket.html +1 -1
  90. package/docs/functions/findPda.html +6 -0
  91. package/docs/functions/findToken.html +1 -1
  92. package/docs/functions/fromBN.html +5 -0
  93. package/docs/functions/getAccount.html +6 -0
  94. package/docs/functions/getActionNonce.html +5 -0
  95. package/docs/functions/getCurrentTps.html +6 -0
  96. package/docs/functions/getInfo.html +5 -0
  97. package/docs/functions/getMedianLatency.html +6 -0
  98. package/docs/functions/getOrderbook.html +6 -0
  99. package/docs/functions/getPeakTps.html +6 -0
  100. package/docs/functions/getTimestamp.html +5 -0
  101. package/docs/functions/getTotalTransactions.html +5 -0
  102. package/docs/functions/getTrades.html +6 -0
  103. package/docs/functions/getUserAccountIds.html +6 -0
  104. package/docs/functions/hexToBuffer.html +4 -0
  105. package/docs/functions/initWebSocketClient.html +12 -0
  106. package/docs/functions/keypairFromPrivateKey.html +4 -0
  107. package/docs/functions/makeSigningFunction.html +4 -0
  108. package/docs/functions/makeWalletSignFn.html +5 -5
  109. package/docs/functions/marketsStats.html +5 -0
  110. package/docs/functions/optExpect.html +4 -4
  111. package/docs/functions/optMap.html +5 -5
  112. package/docs/functions/optUnwrap.html +2 -2
  113. package/docs/functions/panic.html +1 -1
  114. package/docs/functions/placeOrder.html +1 -0
  115. package/docs/functions/queryAction.html +6 -0
  116. package/docs/functions/queryBlock.html +6 -0
  117. package/docs/functions/queryLastNBlocks.html +5 -0
  118. package/docs/functions/queryPrometheus.html +6 -0
  119. package/docs/functions/queryRecentActions.html +6 -0
  120. package/docs/functions/queryRecentBlocks.html +6 -0
  121. package/docs/functions/revokeSession.html +1 -0
  122. package/docs/functions/shortenPublicKey.html +5 -0
  123. package/docs/functions/signAction.html +2 -2
  124. package/docs/functions/toBN.html +5 -0
  125. package/docs/functions/toScaledU128.html +5 -5
  126. package/docs/functions/toScaledU64.html +5 -5
  127. package/docs/functions/transfer.html +1 -0
  128. package/docs/functions/withdraw.html +1 -0
  129. package/docs/hierarchy.html +1 -0
  130. package/docs/index.html +39 -20
  131. package/docs/interfaces/Account.html +8 -8
  132. package/docs/interfaces/ActionInfo.html +8 -8
  133. package/docs/interfaces/ActionNonceResponse.html +3 -0
  134. package/docs/interfaces/ActionQuery.html +4 -4
  135. package/docs/interfaces/ActionResponse.html +8 -8
  136. package/docs/interfaces/ActionsExtendedInfo.html +10 -10
  137. package/docs/interfaces/ActionsQuery.html +5 -5
  138. package/docs/interfaces/ActionsResponse.html +6 -6
  139. package/docs/interfaces/AggregateMetrics.html +12 -12
  140. package/docs/interfaces/BlockFacts.html +10 -0
  141. package/docs/interfaces/BlockQuery.html +6 -6
  142. package/docs/interfaces/BlockResponse.html +6 -6
  143. package/docs/interfaces/BlockSummary.html +8 -8
  144. package/docs/interfaces/BlockSummaryResponse.html +6 -6
  145. package/docs/interfaces/DeltaEvent.html +6 -6
  146. package/docs/interfaces/DepositSplParams.html +10 -0
  147. package/docs/interfaces/Info.html +3 -3
  148. package/docs/interfaces/Market.html +8 -6
  149. package/docs/interfaces/MarketStats.html +7 -7
  150. package/docs/interfaces/MarketsStatsResponse.html +2 -2
  151. package/docs/interfaces/NordConfig.html +14 -5
  152. package/docs/interfaces/NordWebSocketClientEvents.html +4 -0
  153. package/docs/interfaces/NordWebSocketEvents.html +8 -0
  154. package/docs/interfaces/Order.html +6 -6
  155. package/docs/interfaces/OrderInfo.html +6 -6
  156. package/docs/interfaces/OrderbookEntry.html +4 -0
  157. package/docs/interfaces/OrderbookQuery.html +6 -0
  158. package/docs/interfaces/OrderbookResponse.html +6 -10
  159. package/docs/interfaces/OrderbookSubscription.html +159 -0
  160. package/docs/interfaces/PerpMarketStats.html +5 -5
  161. package/docs/interfaces/RollmanActionExtendedInfo.html +4 -4
  162. package/docs/interfaces/RollmanActionInfo.html +4 -4
  163. package/docs/interfaces/RollmanActionResponse.html +4 -4
  164. package/docs/interfaces/RollmanActionsResponse.html +2 -2
  165. package/docs/interfaces/RollmanBlockResponse.html +3 -3
  166. package/docs/interfaces/SPLTokenInfo.html +10 -0
  167. package/docs/interfaces/SolanaBridgeConfig.html +10 -0
  168. package/docs/interfaces/StateFacts.html +10 -0
  169. package/docs/interfaces/SubscriberConfig.html +3 -3
  170. package/docs/interfaces/TimestampResponse.html +3 -0
  171. package/docs/interfaces/Token.html +5 -5
  172. package/docs/interfaces/TokenInfo.html +5 -0
  173. package/docs/interfaces/Trade.html +5 -5
  174. package/docs/interfaces/TradeSubscription.html +159 -0
  175. package/docs/interfaces/Trades.html +5 -5
  176. package/docs/interfaces/TradesQuery.html +6 -0
  177. package/docs/interfaces/TradesResponse.html +7 -12
  178. package/docs/interfaces/TransferParams.html +8 -0
  179. package/docs/interfaces/UserAccountIdsQuery.html +3 -0
  180. package/docs/interfaces/UserAccountIdsResponse.html +3 -0
  181. package/docs/interfaces/WebSocketDeltaUpdate.html +9 -0
  182. package/docs/interfaces/WebSocketSubscription.html +4 -0
  183. package/docs/interfaces/WebSocketTradeUpdate.html +6 -0
  184. package/docs/interfaces/WebSocketUserUpdate.html +6 -0
  185. package/docs/interfaces/WithdrawalClaim.html +14 -0
  186. package/docs/interfaces/WithdrawalParams.html +8 -0
  187. package/docs/modules.html +1 -77
  188. package/docs/types/BigIntValue.html +2 -2
  189. package/docs/types/WebSocketMessage.html +1 -0
  190. package/docs/variables/DEBUG_KEYS.html +1 -1
  191. package/docs/variables/DEFAULT_FUNDING_AMOUNTS.html +1 -1
  192. package/docs/variables/DEV_TOKEN_INFOS.html +1 -1
  193. package/docs/variables/DEV_URL.html +1 -1
  194. package/docs/variables/MAX_BUFFER_LEN.html +1 -1
  195. package/docs/variables/SESSION_TTL.html +1 -1
  196. package/docs/variables/WEBSERVER_DEV_URL.html +1 -1
  197. package/docs/variables/ZERO_DECIMAL.html +1 -1
  198. package/docs/variables/_private.html +2 -0
  199. package/eslint.config.mjs +66 -0
  200. package/package.json +20 -23
  201. package/src/bridge/client.ts +487 -0
  202. package/src/bridge/const.ts +53 -0
  203. package/src/bridge/index.ts +7 -0
  204. package/src/bridge/types.ts +127 -0
  205. package/src/bridge/utils.ts +140 -0
  206. package/src/const.ts +4 -9
  207. package/src/gen/common.ts +27 -10
  208. package/src/gen/nord.ts +1045 -487
  209. package/src/idl/bridge.ts +702 -0
  210. package/src/index.ts +21 -2
  211. package/src/nord/{actions.ts → api/actions.ts} +12 -16
  212. package/src/nord/api/core.ts +130 -0
  213. package/src/nord/api/market.ts +125 -0
  214. package/src/nord/api/metrics.ts +154 -0
  215. package/src/nord/api/queries.ts +236 -0
  216. package/src/nord/client/Nord.ts +652 -0
  217. package/src/nord/client/NordUser.ts +1101 -0
  218. package/src/nord/index.ts +16 -2
  219. package/src/nord/models/Subscriber.ts +56 -0
  220. package/src/nord/utils/NordError.ts +72 -0
  221. package/src/types.ts +163 -92
  222. package/src/utils.ts +22 -1
  223. package/src/websocket/NordWebSocketClient.ts +432 -0
  224. package/src/websocket/events.ts +31 -0
  225. package/src/websocket/index.ts +2 -0
  226. package/tsconfig.eslint.json +12 -0
  227. package/.eslintignore +0 -1
  228. package/.eslintrc.js +0 -20
  229. package/dist/abis/ERC20_ABI.d.ts +0 -39
  230. package/dist/abis/ERC20_ABI.js +0 -313
  231. package/dist/abis/NORD_GETTERS_FACET_ABI.d.ts +0 -34
  232. package/dist/abis/NORD_GETTERS_FACET_ABI.js +0 -195
  233. package/dist/abis/NORD_RAMP_FACET_ABI.d.ts +0 -35
  234. package/dist/abis/NORD_RAMP_FACET_ABI.js +0 -144
  235. package/dist/abis/index.d.ts +0 -3
  236. package/dist/abis/index.js +0 -9
  237. package/dist/nord/Nord.d.ts +0 -76
  238. package/dist/nord/Nord.js +0 -376
  239. package/dist/nord/NordImpl.d.ts +0 -7
  240. package/dist/nord/NordImpl.js +0 -6
  241. package/dist/nord/NordUser.d.ts +0 -77
  242. package/dist/nord/NordUser.js +0 -249
  243. package/docs/functions/createWebSocketSubscription.html +0 -12
  244. package/docs/interfaces/ERC20TokenInfo.html +0 -5
  245. package/docs/interfaces/OrderbookOrder.html +0 -6
  246. package/docs/interfaces/TradeInfo.html +0 -20
  247. package/docs/interfaces/TradesQueryParams.html +0 -10
  248. package/docs/variables/DEV_CONTRACT_ADDRESS.html +0 -1
  249. package/docs/variables/ERC20_ABI.html +0 -1
  250. package/docs/variables/EVM_DEV_URL.html +0 -1
  251. package/docs/variables/FAUCET_PRIVATE_ADDRESS.html +0 -1
  252. package/docs/variables/NORD_GETTERS_FACET_ABI.html +0 -1
  253. package/docs/variables/NORD_RAMP_FACET_ABI.html +0 -1
  254. package/src/abis/ERC20_ABI.ts +0 -310
  255. package/src/abis/NORD_GETTERS_FACET_ABI.ts +0 -192
  256. package/src/abis/NORD_RAMP_FACET_ABI.ts +0 -141
  257. package/src/abis/index.ts +0 -3
  258. package/src/nord/Nord.ts +0 -504
  259. package/src/nord/NordImpl.ts +0 -8
  260. package/src/nord/NordUser.ts +0 -469
@@ -0,0 +1,2 @@
1
+ import { Idl } from "@coral-xyz/anchor";
2
+ export declare const BRIDGE_IDL: Idl;
@@ -0,0 +1,703 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BRIDGE_IDL = void 0;
4
+ exports.BRIDGE_IDL = {
5
+ address: "",
6
+ metadata: {
7
+ name: "bridge",
8
+ version: "0.1.0",
9
+ spec: "0.1.0",
10
+ description: "Created with Anchor",
11
+ },
12
+ instructions: [
13
+ {
14
+ name: "deposit_spl",
15
+ discriminator: [224, 0, 198, 175, 198, 47, 105, 204],
16
+ accounts: [
17
+ {
18
+ name: "depositor",
19
+ writable: true,
20
+ signer: true,
21
+ },
22
+ {
23
+ name: "deposit",
24
+ writable: true,
25
+ },
26
+ {
27
+ name: "prev_deposit",
28
+ optional: true,
29
+ pda: {
30
+ seeds: [
31
+ {
32
+ kind: "const",
33
+ value: [
34
+ 100, 101, 112, 111, 115, 105, 116, 95, 115, 116, 111, 114, 97,
35
+ 103, 101,
36
+ ],
37
+ },
38
+ {
39
+ kind: "account",
40
+ path: "contract_storage.last_deposit_index",
41
+ account: "ContractStorage",
42
+ },
43
+ ],
44
+ },
45
+ },
46
+ {
47
+ name: "asset_whitelisted",
48
+ pda: {
49
+ seeds: [
50
+ {
51
+ kind: "const",
52
+ value: [
53
+ 97, 115, 115, 101, 116, 95, 119, 104, 105, 116, 101, 108, 105,
54
+ 115, 116, 101, 100,
55
+ ],
56
+ },
57
+ {
58
+ kind: "account",
59
+ path: "from_account.mint",
60
+ },
61
+ ],
62
+ },
63
+ },
64
+ {
65
+ name: "contract_storage",
66
+ writable: true,
67
+ pda: {
68
+ seeds: [
69
+ {
70
+ kind: "const",
71
+ value: [
72
+ 99, 111, 110, 116, 114, 97, 99, 116, 95, 115, 116, 111, 114,
73
+ 97, 103, 101,
74
+ ],
75
+ },
76
+ ],
77
+ },
78
+ },
79
+ {
80
+ name: "from_account",
81
+ writable: true,
82
+ },
83
+ {
84
+ name: "to_account",
85
+ writable: true,
86
+ },
87
+ {
88
+ name: "token_program",
89
+ },
90
+ {
91
+ name: "system_program",
92
+ address: "11111111111111111111111111111111",
93
+ },
94
+ ],
95
+ args: [
96
+ {
97
+ name: "amount",
98
+ type: "u64",
99
+ },
100
+ ],
101
+ },
102
+ {
103
+ name: "finalize_block",
104
+ discriminator: [63, 101, 92, 132, 135, 251, 98, 177],
105
+ accounts: [
106
+ {
107
+ name: "payer",
108
+ writable: true,
109
+ signer: true,
110
+ },
111
+ {
112
+ name: "block",
113
+ writable: true,
114
+ pda: {
115
+ seeds: [
116
+ {
117
+ kind: "const",
118
+ value: [
119
+ 98, 108, 111, 99, 107, 95, 115, 116, 111, 114, 97, 103, 101,
120
+ ],
121
+ },
122
+ {
123
+ kind: "arg",
124
+ path: "block_id",
125
+ },
126
+ ],
127
+ },
128
+ },
129
+ {
130
+ name: "contract_storage",
131
+ writable: true,
132
+ pda: {
133
+ seeds: [
134
+ {
135
+ kind: "const",
136
+ value: [
137
+ 99, 111, 110, 116, 114, 97, 99, 116, 95, 115, 116, 111, 114,
138
+ 97, 103, 101,
139
+ ],
140
+ },
141
+ ],
142
+ },
143
+ },
144
+ {
145
+ name: "system_program",
146
+ address: "11111111111111111111111111111111",
147
+ },
148
+ ],
149
+ args: [
150
+ {
151
+ name: "state_update_id",
152
+ type: "u64",
153
+ },
154
+ ],
155
+ },
156
+ {
157
+ name: "finalize_da_fact",
158
+ discriminator: [6, 135, 30, 141, 5, 246, 223, 58],
159
+ accounts: [
160
+ {
161
+ name: "payer",
162
+ writable: true,
163
+ signer: true,
164
+ },
165
+ {
166
+ name: "fact_state_storage",
167
+ writable: true,
168
+ pda: {
169
+ seeds: [
170
+ {
171
+ kind: "const",
172
+ value: [
173
+ 100, 97, 95, 102, 97, 99, 116, 95, 115, 116, 111, 114, 97,
174
+ 103, 101,
175
+ ],
176
+ },
177
+ {
178
+ kind: "arg",
179
+ path: "fact",
180
+ },
181
+ ],
182
+ },
183
+ },
184
+ {
185
+ name: "system_program",
186
+ address: "11111111111111111111111111111111",
187
+ },
188
+ ],
189
+ args: [
190
+ {
191
+ name: "fact",
192
+ type: {
193
+ array: ["u8", 32],
194
+ },
195
+ },
196
+ ],
197
+ },
198
+ {
199
+ name: "initialize",
200
+ discriminator: [175, 175, 109, 31, 13, 152, 155, 237],
201
+ accounts: [
202
+ {
203
+ name: "payer",
204
+ writable: true,
205
+ signer: true,
206
+ },
207
+ {
208
+ name: "program",
209
+ signer: true,
210
+ address: "CVDFLCAjXhVWiPXH9nTCTpCgVzmDVoiPzNJYuccr1dqB",
211
+ },
212
+ {
213
+ name: "contract_storage",
214
+ writable: true,
215
+ pda: {
216
+ seeds: [
217
+ {
218
+ kind: "const",
219
+ value: [
220
+ 99, 111, 110, 116, 114, 97, 99, 116, 95, 115, 116, 111, 114,
221
+ 97, 103, 101,
222
+ ],
223
+ },
224
+ ],
225
+ },
226
+ },
227
+ {
228
+ name: "system_program",
229
+ address: "11111111111111111111111111111111",
230
+ },
231
+ ],
232
+ args: [
233
+ {
234
+ name: "operator",
235
+ type: "pubkey",
236
+ },
237
+ {
238
+ name: "initial_app_state_commitment",
239
+ type: {
240
+ array: ["u8", 32],
241
+ },
242
+ },
243
+ ],
244
+ },
245
+ {
246
+ name: "propose_block",
247
+ discriminator: [147, 21, 105, 53, 152, 116, 128, 187],
248
+ accounts: [
249
+ {
250
+ name: "operator",
251
+ writable: true,
252
+ signer: true,
253
+ },
254
+ {
255
+ name: "block",
256
+ writable: true,
257
+ },
258
+ {
259
+ name: "last_deposit",
260
+ optional: true,
261
+ pda: {
262
+ seeds: [
263
+ {
264
+ kind: "const",
265
+ value: [
266
+ 100, 101, 112, 111, 115, 105, 116, 95, 115, 116, 111, 114, 97,
267
+ 103, 101,
268
+ ],
269
+ },
270
+ {
271
+ kind: "arg",
272
+ path: "facts.next_state_facts.last_deposit_index",
273
+ },
274
+ ],
275
+ },
276
+ },
277
+ {
278
+ name: "da_fact_state",
279
+ },
280
+ {
281
+ name: "contract_storage",
282
+ writable: true,
283
+ pda: {
284
+ seeds: [
285
+ {
286
+ kind: "const",
287
+ value: [
288
+ 99, 111, 110, 116, 114, 97, 99, 116, 95, 115, 116, 111, 114,
289
+ 97, 103, 101,
290
+ ],
291
+ },
292
+ ],
293
+ },
294
+ },
295
+ {
296
+ name: "system_program",
297
+ address: "11111111111111111111111111111111",
298
+ },
299
+ ],
300
+ args: [
301
+ {
302
+ name: "facts",
303
+ type: {
304
+ defined: {
305
+ name: "BlockFacts",
306
+ },
307
+ },
308
+ },
309
+ ],
310
+ },
311
+ {
312
+ name: "whitelist_asset",
313
+ discriminator: [113, 64, 172, 191, 33, 33, 57, 18],
314
+ accounts: [
315
+ {
316
+ name: "operator",
317
+ writable: true,
318
+ signer: true,
319
+ },
320
+ {
321
+ name: "contract_storage",
322
+ pda: {
323
+ seeds: [
324
+ {
325
+ kind: "const",
326
+ value: [
327
+ 99, 111, 110, 116, 114, 97, 99, 116, 95, 115, 116, 111, 114,
328
+ 97, 103, 101,
329
+ ],
330
+ },
331
+ ],
332
+ },
333
+ },
334
+ {
335
+ name: "asset_whitelisted",
336
+ writable: true,
337
+ pda: {
338
+ seeds: [
339
+ {
340
+ kind: "const",
341
+ value: [
342
+ 97, 115, 115, 101, 116, 95, 119, 104, 105, 116, 101, 108, 105,
343
+ 115, 116, 101, 100,
344
+ ],
345
+ },
346
+ {
347
+ kind: "arg",
348
+ path: "asset",
349
+ },
350
+ ],
351
+ },
352
+ },
353
+ {
354
+ name: "system_program",
355
+ address: "11111111111111111111111111111111",
356
+ },
357
+ ],
358
+ args: [
359
+ {
360
+ name: "asset",
361
+ type: "pubkey",
362
+ },
363
+ ],
364
+ },
365
+ {
366
+ name: "withdraw",
367
+ discriminator: [183, 18, 70, 156, 148, 109, 161, 34],
368
+ accounts: [
369
+ {
370
+ name: "payer",
371
+ writable: true,
372
+ signer: true,
373
+ },
374
+ {
375
+ name: "state_update",
376
+ pda: {
377
+ seeds: [
378
+ {
379
+ kind: "const",
380
+ value: [
381
+ 98, 108, 111, 99, 107, 95, 115, 116, 111, 114, 97, 103, 101,
382
+ ],
383
+ },
384
+ {
385
+ kind: "arg",
386
+ path: "claim.block_id",
387
+ },
388
+ ],
389
+ },
390
+ },
391
+ {
392
+ name: "withdrawal_nullifier",
393
+ writable: true,
394
+ pda: {
395
+ seeds: [
396
+ {
397
+ kind: "const",
398
+ value: [
399
+ 119, 105, 116, 104, 100, 114, 97, 119, 97, 108, 95, 110, 117,
400
+ 108, 108, 105, 102, 105, 101, 114,
401
+ ],
402
+ },
403
+ {
404
+ kind: "arg",
405
+ path: "claim.block_id",
406
+ },
407
+ {
408
+ kind: "arg",
409
+ path: "claim.leaf_index",
410
+ },
411
+ ],
412
+ },
413
+ },
414
+ {
415
+ name: "from_account",
416
+ writable: true,
417
+ },
418
+ {
419
+ name: "to_account",
420
+ writable: true,
421
+ },
422
+ {
423
+ name: "authority",
424
+ pda: {
425
+ seeds: [
426
+ {
427
+ kind: "const",
428
+ value: [97, 117, 116, 104, 111, 114, 105, 116, 121],
429
+ },
430
+ ],
431
+ },
432
+ },
433
+ {
434
+ name: "token_program",
435
+ },
436
+ {
437
+ name: "system_program",
438
+ address: "11111111111111111111111111111111",
439
+ },
440
+ ],
441
+ args: [
442
+ {
443
+ name: "claim",
444
+ type: {
445
+ defined: {
446
+ name: "WithdrawalClaim",
447
+ },
448
+ },
449
+ },
450
+ ],
451
+ },
452
+ ],
453
+ accounts: [
454
+ {
455
+ name: "AssetWhitelisted",
456
+ discriminator: [170, 42, 144, 120, 189, 54, 255, 166],
457
+ },
458
+ {
459
+ name: "Block",
460
+ discriminator: [12, 72, 207, 108, 1, 228, 167, 221],
461
+ },
462
+ {
463
+ name: "ContractStorage",
464
+ discriminator: [25, 54, 49, 22, 181, 75, 2, 133],
465
+ },
466
+ {
467
+ name: "Deposit",
468
+ discriminator: [148, 146, 121, 66, 207, 173, 21, 227],
469
+ },
470
+ {
471
+ name: "FactStateStorage",
472
+ discriminator: [98, 222, 3, 112, 154, 244, 201, 242],
473
+ },
474
+ {
475
+ name: "WithdrawalNullifier",
476
+ discriminator: [38, 166, 12, 163, 155, 29, 202, 100],
477
+ },
478
+ ],
479
+ types: [
480
+ {
481
+ name: "AssetWhitelisted",
482
+ type: {
483
+ kind: "struct",
484
+ fields: [],
485
+ },
486
+ },
487
+ {
488
+ name: "Block",
489
+ type: {
490
+ kind: "struct",
491
+ fields: [
492
+ {
493
+ name: "facts",
494
+ type: {
495
+ defined: {
496
+ name: "BlockFacts",
497
+ },
498
+ },
499
+ },
500
+ {
501
+ name: "finalized",
502
+ type: "bool",
503
+ },
504
+ ],
505
+ },
506
+ },
507
+ {
508
+ name: "BlockFacts",
509
+ type: {
510
+ kind: "struct",
511
+ fields: [
512
+ {
513
+ name: "prev_state_facts",
514
+ type: {
515
+ defined: {
516
+ name: "StateFacts",
517
+ },
518
+ },
519
+ },
520
+ {
521
+ name: "next_state_facts",
522
+ type: {
523
+ defined: {
524
+ name: "StateFacts",
525
+ },
526
+ },
527
+ },
528
+ {
529
+ name: "da_commitment",
530
+ type: {
531
+ array: ["u8", 32],
532
+ },
533
+ },
534
+ {
535
+ name: "withdrawal_root",
536
+ type: {
537
+ array: ["u8", 32],
538
+ },
539
+ },
540
+ ],
541
+ },
542
+ },
543
+ {
544
+ name: "ContractStorage",
545
+ type: {
546
+ kind: "struct",
547
+ fields: [
548
+ {
549
+ name: "operator",
550
+ type: "pubkey",
551
+ },
552
+ {
553
+ name: "last_block_id",
554
+ type: "u64",
555
+ },
556
+ {
557
+ name: "last_deposit_index",
558
+ type: "u64",
559
+ },
560
+ {
561
+ name: "fina_block_id",
562
+ type: "u64",
563
+ },
564
+ {
565
+ name: "fina_state_facts",
566
+ type: {
567
+ defined: {
568
+ name: "StateFacts",
569
+ },
570
+ },
571
+ },
572
+ ],
573
+ },
574
+ },
575
+ {
576
+ name: "Deposit",
577
+ type: {
578
+ kind: "struct",
579
+ fields: [
580
+ {
581
+ name: "transfer",
582
+ type: {
583
+ defined: {
584
+ name: "TransferParams",
585
+ },
586
+ },
587
+ },
588
+ {
589
+ name: "prev_deposit_root",
590
+ type: {
591
+ array: ["u8", 32],
592
+ },
593
+ },
594
+ ],
595
+ },
596
+ },
597
+ {
598
+ name: "FactState",
599
+ type: {
600
+ kind: "enum",
601
+ variants: [
602
+ {
603
+ name: "Pending",
604
+ },
605
+ {
606
+ name: "Finalized",
607
+ },
608
+ ],
609
+ },
610
+ },
611
+ {
612
+ name: "FactStateStorage",
613
+ type: {
614
+ kind: "struct",
615
+ fields: [
616
+ {
617
+ name: "state",
618
+ type: {
619
+ defined: {
620
+ name: "FactState",
621
+ },
622
+ },
623
+ },
624
+ ],
625
+ },
626
+ },
627
+ {
628
+ name: "StateFacts",
629
+ type: {
630
+ kind: "struct",
631
+ fields: [
632
+ {
633
+ name: "app_state_commitment",
634
+ type: {
635
+ array: ["u8", 32],
636
+ },
637
+ },
638
+ {
639
+ name: "deposit_root",
640
+ type: {
641
+ array: ["u8", 32],
642
+ },
643
+ },
644
+ {
645
+ name: "last_deposit_index",
646
+ type: "u64",
647
+ },
648
+ {
649
+ name: "last_action_id",
650
+ type: "u64",
651
+ },
652
+ ],
653
+ },
654
+ },
655
+ {
656
+ name: "TransferParams",
657
+ type: {
658
+ kind: "struct",
659
+ fields: [
660
+ {
661
+ name: "user",
662
+ type: "pubkey",
663
+ },
664
+ {
665
+ name: "mint",
666
+ type: "pubkey",
667
+ },
668
+ {
669
+ name: "amount",
670
+ type: "u64",
671
+ },
672
+ ],
673
+ },
674
+ },
675
+ {
676
+ name: "WithdrawalClaim",
677
+ type: {
678
+ kind: "struct",
679
+ fields: [
680
+ {
681
+ name: "user",
682
+ type: "pubkey",
683
+ },
684
+ {
685
+ name: "amount",
686
+ type: "u64",
687
+ },
688
+ {
689
+ name: "block_id",
690
+ type: "u64",
691
+ },
692
+ ],
693
+ },
694
+ },
695
+ {
696
+ name: "WithdrawalNullifier",
697
+ type: {
698
+ kind: "struct",
699
+ fields: [],
700
+ },
701
+ },
702
+ ],
703
+ };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  export * from "./types";
2
2
  export * from "./utils";
3
- export * from "./abis";
4
- export * from "./nord";
5
3
  export * from "./const";
4
+ export * from "./nord";
5
+ export * from "./websocket/index";
6
+ export * from "./bridge/client";
7
+ export * from "./bridge/types";
8
+ export { bridgeToBN, fromBN, keypairFromPrivateKey, makeSigningFunction, findPda, bufferToHex, hexToBuffer, shortenPublicKey, } from "./bridge/utils";