@relay-protocol/settlement-sdk 0.0.64
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.
- package/README.md +3 -0
- package/dist/hub/hub-utils.d.ts +29 -0
- package/dist/hub/hub-utils.js +35 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +45 -0
- package/dist/messages/common/solana-vm/idls/RelayDepositoryIdl.d.ts +383 -0
- package/dist/messages/common/solana-vm/idls/RelayDepositoryIdl.js +901 -0
- package/dist/messages/v2.1/depository-deposit.d.ts +16 -0
- package/dist/messages/v2.1/depository-deposit.js +44 -0
- package/dist/messages/v2.1/depository-withdrawal.d.ts +103 -0
- package/dist/messages/v2.1/depository-withdrawal.js +661 -0
- package/dist/messages/v2.1/solver-fill.d.ts +26 -0
- package/dist/messages/v2.1/solver-fill.js +61 -0
- package/dist/messages/v2.1/solver-refund.d.ts +28 -0
- package/dist/messages/v2.1/solver-refund.js +67 -0
- package/dist/messages/v2.2/execution.d.ts +48 -0
- package/dist/messages/v2.2/execution.js +135 -0
- package/dist/messages/v2.2/withdrawal-execution.d.ts +55 -0
- package/dist/messages/v2.2/withdrawal-execution.js +71 -0
- package/dist/order/index.d.ts +140 -0
- package/dist/order/index.js +230 -0
- package/dist/utils.d.ts +9 -0
- package/dist/utils.js +255 -0
- package/package.json +39 -0
|
@@ -0,0 +1,901 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RelayDepositoryIdl = void 0;
|
|
4
|
+
exports.RelayDepositoryIdl = {
|
|
5
|
+
address: "",
|
|
6
|
+
metadata: {
|
|
7
|
+
name: "relay_depository",
|
|
8
|
+
version: "0.1.0",
|
|
9
|
+
spec: "0.1.0",
|
|
10
|
+
description: "Relay depository program",
|
|
11
|
+
},
|
|
12
|
+
instructions: [
|
|
13
|
+
{
|
|
14
|
+
name: "deposit_native",
|
|
15
|
+
docs: [
|
|
16
|
+
"Deposit native SOL tokens into the vault",
|
|
17
|
+
"",
|
|
18
|
+
"Transfers SOL from the sender to the vault and emits a deposit event.",
|
|
19
|
+
"",
|
|
20
|
+
"# Parameters",
|
|
21
|
+
"* `ctx` - The context containing the accounts",
|
|
22
|
+
"* `amount` - The amount of SOL to deposit",
|
|
23
|
+
"* `id` - A unique identifier for the deposit",
|
|
24
|
+
"",
|
|
25
|
+
"# Returns",
|
|
26
|
+
"* `Ok(())` on success",
|
|
27
|
+
],
|
|
28
|
+
discriminator: [13, 158, 13, 223, 95, 213, 28, 6],
|
|
29
|
+
accounts: [
|
|
30
|
+
{
|
|
31
|
+
name: "relay_depository",
|
|
32
|
+
docs: ["The relay depository account"],
|
|
33
|
+
pda: {
|
|
34
|
+
seeds: [
|
|
35
|
+
{
|
|
36
|
+
kind: "const",
|
|
37
|
+
value: [
|
|
38
|
+
114, 101, 108, 97, 121, 95, 100, 101, 112, 111, 115, 105, 116,
|
|
39
|
+
111, 114, 121,
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: "sender",
|
|
47
|
+
docs: ["The sender of the deposit"],
|
|
48
|
+
writable: true,
|
|
49
|
+
signer: true,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: "depositor",
|
|
53
|
+
docs: ["The account credited for the deposit"],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "vault",
|
|
57
|
+
docs: ["The vault PDA that will receive the SOL"],
|
|
58
|
+
writable: true,
|
|
59
|
+
pda: {
|
|
60
|
+
seeds: [
|
|
61
|
+
{
|
|
62
|
+
kind: "const",
|
|
63
|
+
value: [118, 97, 117, 108, 116],
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "system_program",
|
|
70
|
+
docs: ["The system program"],
|
|
71
|
+
address: "11111111111111111111111111111111",
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
args: [
|
|
75
|
+
{
|
|
76
|
+
name: "amount",
|
|
77
|
+
type: "u64",
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: "id",
|
|
81
|
+
type: {
|
|
82
|
+
array: ["u8", 32],
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: "deposit_token",
|
|
89
|
+
docs: [
|
|
90
|
+
"Deposit SPL tokens into the vault",
|
|
91
|
+
"",
|
|
92
|
+
"Creates the vault's token account if needed, transfers tokens from the sender,",
|
|
93
|
+
"and emits a deposit event.",
|
|
94
|
+
"",
|
|
95
|
+
"# Parameters",
|
|
96
|
+
"* `ctx` - The context containing the accounts",
|
|
97
|
+
"* `amount` - The amount of tokens to deposit",
|
|
98
|
+
"* `id` - A unique identifier for the deposit",
|
|
99
|
+
"",
|
|
100
|
+
"# Returns",
|
|
101
|
+
"* `Ok(())` on success",
|
|
102
|
+
],
|
|
103
|
+
discriminator: [11, 156, 96, 218, 39, 163, 180, 19],
|
|
104
|
+
accounts: [
|
|
105
|
+
{
|
|
106
|
+
name: "relay_depository",
|
|
107
|
+
docs: ["The relay depository account"],
|
|
108
|
+
pda: {
|
|
109
|
+
seeds: [
|
|
110
|
+
{
|
|
111
|
+
kind: "const",
|
|
112
|
+
value: [
|
|
113
|
+
114, 101, 108, 97, 121, 95, 100, 101, 112, 111, 115, 105, 116,
|
|
114
|
+
111, 114, 121,
|
|
115
|
+
],
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: "sender",
|
|
122
|
+
docs: ["The sender of the deposit"],
|
|
123
|
+
writable: true,
|
|
124
|
+
signer: true,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: "depositor",
|
|
128
|
+
docs: ["The account credited for the deposit"],
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: "vault",
|
|
132
|
+
docs: ["The vault PDA that will receive the tokens"],
|
|
133
|
+
pda: {
|
|
134
|
+
seeds: [
|
|
135
|
+
{
|
|
136
|
+
kind: "const",
|
|
137
|
+
value: [118, 97, 117, 108, 116],
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: "mint",
|
|
144
|
+
docs: ["The mint of the token being deposited"],
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: "sender_token_account",
|
|
148
|
+
docs: ["The sender's token account"],
|
|
149
|
+
writable: true,
|
|
150
|
+
pda: {
|
|
151
|
+
seeds: [
|
|
152
|
+
{
|
|
153
|
+
kind: "account",
|
|
154
|
+
path: "sender",
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
kind: "account",
|
|
158
|
+
path: "token_program",
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
kind: "account",
|
|
162
|
+
path: "mint",
|
|
163
|
+
},
|
|
164
|
+
],
|
|
165
|
+
program: {
|
|
166
|
+
kind: "const",
|
|
167
|
+
value: [
|
|
168
|
+
140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
|
|
169
|
+
13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
|
|
170
|
+
219, 233, 248, 89,
|
|
171
|
+
],
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: "vault_token_account",
|
|
177
|
+
writable: true,
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: "token_program",
|
|
181
|
+
docs: ["The token program"],
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: "associated_token_program",
|
|
185
|
+
docs: ["The associated token program"],
|
|
186
|
+
address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: "system_program",
|
|
190
|
+
docs: ["The system program"],
|
|
191
|
+
address: "11111111111111111111111111111111",
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
args: [
|
|
195
|
+
{
|
|
196
|
+
name: "amount",
|
|
197
|
+
type: "u64",
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
name: "id",
|
|
201
|
+
type: {
|
|
202
|
+
array: ["u8", 32],
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
],
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
name: "execute_transfer",
|
|
209
|
+
docs: [
|
|
210
|
+
"Execute a transfer with allocator signature",
|
|
211
|
+
"",
|
|
212
|
+
"Verifies the allocator's signature, transfers tokens to the recipient,",
|
|
213
|
+
"and marks the request as used.",
|
|
214
|
+
"",
|
|
215
|
+
"# Parameters",
|
|
216
|
+
"* `ctx` - The context containing the accounts",
|
|
217
|
+
"* `request` - The transfer request details and signature",
|
|
218
|
+
"",
|
|
219
|
+
"# Returns",
|
|
220
|
+
"* `Ok(())` on success",
|
|
221
|
+
"* `Err(error)` if signature is invalid or request can't be processed",
|
|
222
|
+
],
|
|
223
|
+
discriminator: [233, 126, 160, 184, 235, 206, 31, 119],
|
|
224
|
+
accounts: [
|
|
225
|
+
{
|
|
226
|
+
name: "relay_depository",
|
|
227
|
+
docs: ["The relay depository account"],
|
|
228
|
+
pda: {
|
|
229
|
+
seeds: [
|
|
230
|
+
{
|
|
231
|
+
kind: "const",
|
|
232
|
+
value: [
|
|
233
|
+
114, 101, 108, 97, 121, 95, 100, 101, 112, 111, 115, 105, 116,
|
|
234
|
+
111, 114, 121,
|
|
235
|
+
],
|
|
236
|
+
},
|
|
237
|
+
],
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
name: "executor",
|
|
242
|
+
docs: ["The executor of the transfer"],
|
|
243
|
+
writable: true,
|
|
244
|
+
signer: true,
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
name: "recipient",
|
|
248
|
+
docs: ["The recipient of the transfer"],
|
|
249
|
+
writable: true,
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
name: "vault",
|
|
253
|
+
docs: ["The vault PDA that will receive the tokens"],
|
|
254
|
+
writable: true,
|
|
255
|
+
pda: {
|
|
256
|
+
seeds: [
|
|
257
|
+
{
|
|
258
|
+
kind: "const",
|
|
259
|
+
value: [118, 97, 117, 108, 116],
|
|
260
|
+
},
|
|
261
|
+
],
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
name: "mint",
|
|
266
|
+
docs: ["The mint of the token being transferred"],
|
|
267
|
+
optional: true,
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
name: "recipient_token_account",
|
|
271
|
+
docs: ["The recipient's token account"],
|
|
272
|
+
writable: true,
|
|
273
|
+
optional: true,
|
|
274
|
+
pda: {
|
|
275
|
+
seeds: [
|
|
276
|
+
{
|
|
277
|
+
kind: "account",
|
|
278
|
+
path: "recipient",
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
kind: "account",
|
|
282
|
+
path: "token_program",
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
kind: "account",
|
|
286
|
+
path: "mint",
|
|
287
|
+
},
|
|
288
|
+
],
|
|
289
|
+
program: {
|
|
290
|
+
kind: "const",
|
|
291
|
+
value: [
|
|
292
|
+
140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
|
|
293
|
+
13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
|
|
294
|
+
219, 233, 248, 89,
|
|
295
|
+
],
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
name: "vault_token_account",
|
|
301
|
+
docs: ["The vault's token account"],
|
|
302
|
+
writable: true,
|
|
303
|
+
optional: true,
|
|
304
|
+
pda: {
|
|
305
|
+
seeds: [
|
|
306
|
+
{
|
|
307
|
+
kind: "account",
|
|
308
|
+
path: "vault",
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
kind: "account",
|
|
312
|
+
path: "token_program",
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
kind: "account",
|
|
316
|
+
path: "mint",
|
|
317
|
+
},
|
|
318
|
+
],
|
|
319
|
+
program: {
|
|
320
|
+
kind: "const",
|
|
321
|
+
value: [
|
|
322
|
+
140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142,
|
|
323
|
+
13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216,
|
|
324
|
+
219, 233, 248, 89,
|
|
325
|
+
],
|
|
326
|
+
},
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
name: "used_request",
|
|
331
|
+
docs: [
|
|
332
|
+
"The account that tracks whether a transfer request has been used",
|
|
333
|
+
"",
|
|
334
|
+
"This account is created for each transfer request to prevent replay attacks.",
|
|
335
|
+
],
|
|
336
|
+
writable: true,
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
name: "ix_sysvar",
|
|
340
|
+
docs: ["The instruction sysvar for ed25519 verification"],
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
name: "token_program",
|
|
344
|
+
docs: ["The token program"],
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
name: "associated_token_program",
|
|
348
|
+
docs: ["The associated token program"],
|
|
349
|
+
address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
name: "system_program",
|
|
353
|
+
docs: ["The system program"],
|
|
354
|
+
address: "11111111111111111111111111111111",
|
|
355
|
+
},
|
|
356
|
+
],
|
|
357
|
+
args: [
|
|
358
|
+
{
|
|
359
|
+
name: "request",
|
|
360
|
+
type: {
|
|
361
|
+
defined: {
|
|
362
|
+
name: "TransferRequest",
|
|
363
|
+
},
|
|
364
|
+
},
|
|
365
|
+
},
|
|
366
|
+
],
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
name: "initialize",
|
|
370
|
+
docs: [
|
|
371
|
+
"Initialize the relay depository program with owner and allocator",
|
|
372
|
+
"",
|
|
373
|
+
"Creates and initializes the relay depository account with the specified",
|
|
374
|
+
"owner, allocator, and calculates the domain separator for cross-chain security.",
|
|
375
|
+
"",
|
|
376
|
+
"# Parameters",
|
|
377
|
+
"* `ctx` - The context containing the accounts",
|
|
378
|
+
'* `chain_id` - The chain identifier (e.g., "solana-mainnet")',
|
|
379
|
+
"",
|
|
380
|
+
"# Returns",
|
|
381
|
+
"* `Ok(())` on success",
|
|
382
|
+
],
|
|
383
|
+
discriminator: [175, 175, 109, 31, 13, 152, 155, 237],
|
|
384
|
+
accounts: [
|
|
385
|
+
{
|
|
386
|
+
name: "relay_depository",
|
|
387
|
+
docs: [
|
|
388
|
+
"The relay depository account to be initialized",
|
|
389
|
+
"This is a PDA derived from the RELAY_DEPOSITORY_SEED",
|
|
390
|
+
],
|
|
391
|
+
writable: true,
|
|
392
|
+
pda: {
|
|
393
|
+
seeds: [
|
|
394
|
+
{
|
|
395
|
+
kind: "const",
|
|
396
|
+
value: [
|
|
397
|
+
114, 101, 108, 97, 121, 95, 100, 101, 112, 111, 115, 105, 116,
|
|
398
|
+
111, 114, 121,
|
|
399
|
+
],
|
|
400
|
+
},
|
|
401
|
+
],
|
|
402
|
+
},
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
name: "vault",
|
|
406
|
+
docs: ["PDA that will hold SOL deposits"],
|
|
407
|
+
writable: true,
|
|
408
|
+
pda: {
|
|
409
|
+
seeds: [
|
|
410
|
+
{
|
|
411
|
+
kind: "const",
|
|
412
|
+
value: [118, 97, 117, 108, 116],
|
|
413
|
+
},
|
|
414
|
+
],
|
|
415
|
+
},
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
name: "owner",
|
|
419
|
+
docs: [
|
|
420
|
+
"The owner account that pays for initialization",
|
|
421
|
+
"Must match the AUTHORIZED_PUBKEY",
|
|
422
|
+
],
|
|
423
|
+
writable: true,
|
|
424
|
+
signer: true,
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
name: "allocator",
|
|
428
|
+
docs: [
|
|
429
|
+
"The allocator account that will be authorized to sign transfer requests",
|
|
430
|
+
],
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
name: "system_program",
|
|
434
|
+
address: "11111111111111111111111111111111",
|
|
435
|
+
},
|
|
436
|
+
],
|
|
437
|
+
args: [
|
|
438
|
+
{
|
|
439
|
+
name: "chain_id",
|
|
440
|
+
type: "string",
|
|
441
|
+
},
|
|
442
|
+
],
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
name: "migrate_domain_separator",
|
|
446
|
+
docs: [
|
|
447
|
+
"Migrate an existing RelayDepository account to include the `domain_separator` field.",
|
|
448
|
+
"",
|
|
449
|
+
"Reallocates legacy RelayDepository accounts to add the `domain_separator` field.",
|
|
450
|
+
"The existing data is preserved, and only this new field is appended in place.",
|
|
451
|
+
"Only the account owner can call this once, provided sufficient SOL for rent.",
|
|
452
|
+
"",
|
|
453
|
+
"# Parameters",
|
|
454
|
+
"* `ctx` - The context containing the accounts",
|
|
455
|
+
'* `chain_id` - The chain identifier (e.g., "solana-mainnet")',
|
|
456
|
+
"",
|
|
457
|
+
"# Returns",
|
|
458
|
+
"* `Ok(())` on success",
|
|
459
|
+
"* `Err(error)` if not authorized or domain separator already set",
|
|
460
|
+
],
|
|
461
|
+
discriminator: [125, 28, 21, 67, 230, 227, 107, 79],
|
|
462
|
+
accounts: [
|
|
463
|
+
{
|
|
464
|
+
name: "relay_depository",
|
|
465
|
+
docs: ["The relay depository account to migrate in-place"],
|
|
466
|
+
writable: true,
|
|
467
|
+
pda: {
|
|
468
|
+
seeds: [
|
|
469
|
+
{
|
|
470
|
+
kind: "const",
|
|
471
|
+
value: [
|
|
472
|
+
114, 101, 108, 97, 121, 95, 100, 101, 112, 111, 115, 105, 116,
|
|
473
|
+
111, 114, 121,
|
|
474
|
+
],
|
|
475
|
+
},
|
|
476
|
+
],
|
|
477
|
+
},
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
name: "owner",
|
|
481
|
+
docs: [
|
|
482
|
+
"The owner of the relay depository (also pays for reallocation)",
|
|
483
|
+
],
|
|
484
|
+
writable: true,
|
|
485
|
+
signer: true,
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
name: "system_program",
|
|
489
|
+
docs: ["System program for reallocation"],
|
|
490
|
+
address: "11111111111111111111111111111111",
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
name: "ix_sysvar",
|
|
494
|
+
docs: ["The instruction sysvar for reentrancy protection"],
|
|
495
|
+
},
|
|
496
|
+
],
|
|
497
|
+
args: [
|
|
498
|
+
{
|
|
499
|
+
name: "chain_id",
|
|
500
|
+
type: "string",
|
|
501
|
+
},
|
|
502
|
+
],
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
name: "set_allocator",
|
|
506
|
+
docs: [
|
|
507
|
+
"Update the allocator public key",
|
|
508
|
+
"",
|
|
509
|
+
"Allows the owner to change the authorized allocator that can sign transfer requests.",
|
|
510
|
+
"",
|
|
511
|
+
"# Parameters",
|
|
512
|
+
"* `ctx` - The context containing the accounts",
|
|
513
|
+
"* `new_allocator` - The public key of the new allocator",
|
|
514
|
+
"",
|
|
515
|
+
"# Returns",
|
|
516
|
+
"* `Ok(())` on success",
|
|
517
|
+
"* `Err(error)` if not authorized",
|
|
518
|
+
],
|
|
519
|
+
discriminator: [92, 128, 130, 234, 227, 249, 182, 17],
|
|
520
|
+
accounts: [
|
|
521
|
+
{
|
|
522
|
+
name: "relay_depository",
|
|
523
|
+
docs: ["The relay depository account to update"],
|
|
524
|
+
writable: true,
|
|
525
|
+
pda: {
|
|
526
|
+
seeds: [
|
|
527
|
+
{
|
|
528
|
+
kind: "const",
|
|
529
|
+
value: [
|
|
530
|
+
114, 101, 108, 97, 121, 95, 100, 101, 112, 111, 115, 105, 116,
|
|
531
|
+
111, 114, 121,
|
|
532
|
+
],
|
|
533
|
+
},
|
|
534
|
+
],
|
|
535
|
+
},
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
name: "owner",
|
|
539
|
+
docs: ["The owner of the relay depository"],
|
|
540
|
+
signer: true,
|
|
541
|
+
},
|
|
542
|
+
],
|
|
543
|
+
args: [
|
|
544
|
+
{
|
|
545
|
+
name: "new_allocator",
|
|
546
|
+
type: "pubkey",
|
|
547
|
+
},
|
|
548
|
+
],
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
name: "set_owner",
|
|
552
|
+
docs: [
|
|
553
|
+
"Update the owner public key",
|
|
554
|
+
"",
|
|
555
|
+
"Allows the current owner to transfer ownership to a new address.",
|
|
556
|
+
"",
|
|
557
|
+
"# Parameters",
|
|
558
|
+
"* `ctx` - The context containing the accounts",
|
|
559
|
+
"* `new_owner` - The public key of the new owner",
|
|
560
|
+
"",
|
|
561
|
+
"# Returns",
|
|
562
|
+
"* `Ok(())` on success",
|
|
563
|
+
"* `Err(error)` if not authorized",
|
|
564
|
+
],
|
|
565
|
+
discriminator: [72, 202, 120, 52, 77, 128, 96, 197],
|
|
566
|
+
accounts: [
|
|
567
|
+
{
|
|
568
|
+
name: "relay_depository",
|
|
569
|
+
docs: ["The relay depository account to update"],
|
|
570
|
+
writable: true,
|
|
571
|
+
pda: {
|
|
572
|
+
seeds: [
|
|
573
|
+
{
|
|
574
|
+
kind: "const",
|
|
575
|
+
value: [
|
|
576
|
+
114, 101, 108, 97, 121, 95, 100, 101, 112, 111, 115, 105, 116,
|
|
577
|
+
111, 114, 121,
|
|
578
|
+
],
|
|
579
|
+
},
|
|
580
|
+
],
|
|
581
|
+
},
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
name: "owner",
|
|
585
|
+
docs: ["The current owner of the relay depository"],
|
|
586
|
+
signer: true,
|
|
587
|
+
},
|
|
588
|
+
],
|
|
589
|
+
args: [
|
|
590
|
+
{
|
|
591
|
+
name: "new_owner",
|
|
592
|
+
type: "pubkey",
|
|
593
|
+
},
|
|
594
|
+
],
|
|
595
|
+
},
|
|
596
|
+
],
|
|
597
|
+
accounts: [
|
|
598
|
+
{
|
|
599
|
+
name: "RelayDepository",
|
|
600
|
+
discriminator: [128, 53, 156, 189, 243, 83, 245, 107],
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
name: "UsedRequest",
|
|
604
|
+
discriminator: [135, 134, 110, 77, 150, 98, 180, 107],
|
|
605
|
+
},
|
|
606
|
+
],
|
|
607
|
+
events: [
|
|
608
|
+
{
|
|
609
|
+
name: "DepositEvent",
|
|
610
|
+
discriminator: [120, 248, 61, 83, 31, 142, 107, 144],
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
name: "TransferExecutedEvent",
|
|
614
|
+
discriminator: [92, 10, 178, 184, 18, 44, 120, 124],
|
|
615
|
+
},
|
|
616
|
+
],
|
|
617
|
+
errors: [
|
|
618
|
+
{
|
|
619
|
+
code: 6000,
|
|
620
|
+
name: "TransferRequestAlreadyUsed",
|
|
621
|
+
msg: "Transfer request has already been executed",
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
code: 6001,
|
|
625
|
+
name: "InvalidMint",
|
|
626
|
+
msg: "Invalid mint",
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
code: 6002,
|
|
630
|
+
name: "InvalidTokenProgram",
|
|
631
|
+
msg: "Invalid token program",
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
code: 6003,
|
|
635
|
+
name: "Unauthorized",
|
|
636
|
+
msg: "Unauthorized",
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
code: 6004,
|
|
640
|
+
name: "AllocatorSignerMismatch",
|
|
641
|
+
msg: "Allocator signer mismatch",
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
code: 6005,
|
|
645
|
+
name: "MessageMismatch",
|
|
646
|
+
msg: "Message mismatch",
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
code: 6006,
|
|
650
|
+
name: "MalformedEd25519Data",
|
|
651
|
+
msg: "Malformed Ed25519 data",
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
code: 6007,
|
|
655
|
+
name: "MissingSignature",
|
|
656
|
+
msg: "Missing signature",
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
code: 6008,
|
|
660
|
+
name: "SignatureExpired",
|
|
661
|
+
msg: "Signature expired",
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
code: 6009,
|
|
665
|
+
name: "InvalidRecipient",
|
|
666
|
+
msg: "Invalid recipient",
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
code: 6010,
|
|
670
|
+
name: "InvalidVaultTokenAccount",
|
|
671
|
+
msg: "Invalid vault token account",
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
code: 6011,
|
|
675
|
+
name: "InsufficientVaultBalance",
|
|
676
|
+
msg: "Vault has insufficient balance to remain rent-exempt after transfer",
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
code: 6012,
|
|
680
|
+
name: "InvalidDomainSeparator",
|
|
681
|
+
msg: "Invalid domain separator",
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
code: 6013,
|
|
685
|
+
name: "DomainSeparatorAlreadySet",
|
|
686
|
+
msg: "Domain separator already set",
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
code: 6014,
|
|
690
|
+
name: "InvalidVaultAddress",
|
|
691
|
+
msg: "Invalid vault address",
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
code: 6015,
|
|
695
|
+
name: "AccountWriteFailed",
|
|
696
|
+
msg: "Failed to write account data",
|
|
697
|
+
},
|
|
698
|
+
{
|
|
699
|
+
code: 6016,
|
|
700
|
+
name: "InvalidRelayDepositoryPDA",
|
|
701
|
+
msg: "Invalid RelayDepository PDA",
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
code: 6017,
|
|
705
|
+
name: "MalformedAccount",
|
|
706
|
+
msg: "Malformed account data",
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
code: 6018,
|
|
710
|
+
name: "InvalidAccountDiscriminator",
|
|
711
|
+
msg: "Invalid account discriminator",
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
code: 6019,
|
|
715
|
+
name: "ReentrancyDetected",
|
|
716
|
+
msg: "Reentrancy detected",
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
code: 6020,
|
|
720
|
+
name: "InvalidAccountSize",
|
|
721
|
+
msg: "Invalid account size for migration",
|
|
722
|
+
},
|
|
723
|
+
],
|
|
724
|
+
types: [
|
|
725
|
+
{
|
|
726
|
+
name: "DepositEvent",
|
|
727
|
+
docs: ["Event emitted when a deposit is made"],
|
|
728
|
+
type: {
|
|
729
|
+
kind: "struct",
|
|
730
|
+
fields: [
|
|
731
|
+
{
|
|
732
|
+
name: "depositor",
|
|
733
|
+
docs: ["The public key of the depositor"],
|
|
734
|
+
type: "pubkey",
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
name: "token",
|
|
738
|
+
docs: [
|
|
739
|
+
"The token mint (None for native SOL, Some(mint) for SPL tokens)",
|
|
740
|
+
],
|
|
741
|
+
type: {
|
|
742
|
+
option: "pubkey",
|
|
743
|
+
},
|
|
744
|
+
},
|
|
745
|
+
{
|
|
746
|
+
name: "amount",
|
|
747
|
+
docs: ["The amount deposited"],
|
|
748
|
+
type: "u64",
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
name: "id",
|
|
752
|
+
docs: ["A unique identifier for the deposit"],
|
|
753
|
+
type: {
|
|
754
|
+
array: ["u8", 32],
|
|
755
|
+
},
|
|
756
|
+
},
|
|
757
|
+
],
|
|
758
|
+
},
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
name: "RelayDepository",
|
|
762
|
+
docs: [
|
|
763
|
+
"Relay depository account that stores configuration and state",
|
|
764
|
+
"",
|
|
765
|
+
"This account is a PDA derived from the `RELAY_DEPOSITORY_SEED` and",
|
|
766
|
+
"contains the ownership and allocation information.",
|
|
767
|
+
],
|
|
768
|
+
type: {
|
|
769
|
+
kind: "struct",
|
|
770
|
+
fields: [
|
|
771
|
+
{
|
|
772
|
+
name: "owner",
|
|
773
|
+
docs: ["The owner of the relay depository who can update settings"],
|
|
774
|
+
type: "pubkey",
|
|
775
|
+
},
|
|
776
|
+
{
|
|
777
|
+
name: "allocator",
|
|
778
|
+
docs: ["The authorized allocator that can sign transfer requests"],
|
|
779
|
+
type: "pubkey",
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
name: "vault_bump",
|
|
783
|
+
docs: [
|
|
784
|
+
"The bump seed for the vault PDA, used for deriving the vault address",
|
|
785
|
+
],
|
|
786
|
+
type: "u8",
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
name: "domain_separator",
|
|
790
|
+
docs: [
|
|
791
|
+
"Expected domain separator hash for this deployment (Optional for upgrade compatibility)",
|
|
792
|
+
],
|
|
793
|
+
type: {
|
|
794
|
+
option: {
|
|
795
|
+
array: ["u8", 32],
|
|
796
|
+
},
|
|
797
|
+
},
|
|
798
|
+
},
|
|
799
|
+
],
|
|
800
|
+
},
|
|
801
|
+
},
|
|
802
|
+
{
|
|
803
|
+
name: "TransferExecutedEvent",
|
|
804
|
+
docs: ["Event emitted when a transfer is executed"],
|
|
805
|
+
type: {
|
|
806
|
+
kind: "struct",
|
|
807
|
+
fields: [
|
|
808
|
+
{
|
|
809
|
+
name: "request",
|
|
810
|
+
docs: ["The transfer request that was executed"],
|
|
811
|
+
type: {
|
|
812
|
+
defined: {
|
|
813
|
+
name: "TransferRequest",
|
|
814
|
+
},
|
|
815
|
+
},
|
|
816
|
+
},
|
|
817
|
+
{
|
|
818
|
+
name: "executor",
|
|
819
|
+
docs: ["The public key of the executor who processed the transfer"],
|
|
820
|
+
type: "pubkey",
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
name: "id",
|
|
824
|
+
docs: ["The unique identifier for the used request account"],
|
|
825
|
+
type: "pubkey",
|
|
826
|
+
},
|
|
827
|
+
],
|
|
828
|
+
},
|
|
829
|
+
},
|
|
830
|
+
{
|
|
831
|
+
name: "TransferRequest",
|
|
832
|
+
docs: [
|
|
833
|
+
"Structure representing a transfer request signed by the allocator",
|
|
834
|
+
],
|
|
835
|
+
type: {
|
|
836
|
+
kind: "struct",
|
|
837
|
+
fields: [
|
|
838
|
+
{
|
|
839
|
+
name: "domain",
|
|
840
|
+
docs: ["Domain separator"],
|
|
841
|
+
type: {
|
|
842
|
+
array: ["u8", 32],
|
|
843
|
+
},
|
|
844
|
+
},
|
|
845
|
+
{
|
|
846
|
+
name: "recipient",
|
|
847
|
+
docs: ["The recipient of the transfer"],
|
|
848
|
+
type: "pubkey",
|
|
849
|
+
},
|
|
850
|
+
{
|
|
851
|
+
name: "token",
|
|
852
|
+
docs: [
|
|
853
|
+
"The token mint (None for native SOL, Some(mint) for SPL tokens)",
|
|
854
|
+
],
|
|
855
|
+
type: {
|
|
856
|
+
option: "pubkey",
|
|
857
|
+
},
|
|
858
|
+
},
|
|
859
|
+
{
|
|
860
|
+
name: "amount",
|
|
861
|
+
docs: ["The amount to transfer"],
|
|
862
|
+
type: "u64",
|
|
863
|
+
},
|
|
864
|
+
{
|
|
865
|
+
name: "nonce",
|
|
866
|
+
docs: ["A unique nonce"],
|
|
867
|
+
type: "u64",
|
|
868
|
+
},
|
|
869
|
+
{
|
|
870
|
+
name: "expiration",
|
|
871
|
+
docs: ["The expiration timestamp for the request"],
|
|
872
|
+
type: "i64",
|
|
873
|
+
},
|
|
874
|
+
{
|
|
875
|
+
name: "vault_address",
|
|
876
|
+
docs: ["The vault address that funds will be withdrawn from"],
|
|
877
|
+
type: "pubkey",
|
|
878
|
+
},
|
|
879
|
+
],
|
|
880
|
+
},
|
|
881
|
+
},
|
|
882
|
+
{
|
|
883
|
+
name: "UsedRequest",
|
|
884
|
+
docs: [
|
|
885
|
+
"Account that tracks whether a transfer request has been used",
|
|
886
|
+
"",
|
|
887
|
+
"This account is created for each transfer request to prevent replay attacks.",
|
|
888
|
+
],
|
|
889
|
+
type: {
|
|
890
|
+
kind: "struct",
|
|
891
|
+
fields: [
|
|
892
|
+
{
|
|
893
|
+
name: "is_used",
|
|
894
|
+
docs: ["Flag indicating whether the request has been processed"],
|
|
895
|
+
type: "bool",
|
|
896
|
+
},
|
|
897
|
+
],
|
|
898
|
+
},
|
|
899
|
+
},
|
|
900
|
+
],
|
|
901
|
+
};
|