@jpool/bond-sdk 0.10.5 → 0.11.0-next.3
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/dist/index.d.mts +755 -710
- package/dist/index.d.ts +755 -710
- package/dist/index.js +125 -48
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +125 -48
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -11,28 +11,28 @@ import { PublicKey, PublicKeyInitData, Cluster, Transaction, VersionedTransactio
|
|
|
11
11
|
* IDL can be found at `target/idl/jbond.json`.
|
|
12
12
|
*/
|
|
13
13
|
type Jbond = {
|
|
14
|
-
address:
|
|
15
|
-
metadata: {
|
|
16
|
-
name:
|
|
17
|
-
version:
|
|
18
|
-
spec:
|
|
19
|
-
description:
|
|
14
|
+
"address": "Fo17edWRJewZNTRibgx9iTfjywCW6dzS81VwBLmPFVq1";
|
|
15
|
+
"metadata": {
|
|
16
|
+
"name": "jbond";
|
|
17
|
+
"version": "0.2.1";
|
|
18
|
+
"spec": "0.1.0";
|
|
19
|
+
"description": "Jpool Bond Program";
|
|
20
20
|
};
|
|
21
|
-
instructions: [
|
|
21
|
+
"instructions": [
|
|
22
22
|
{
|
|
23
|
-
name:
|
|
24
|
-
docs: [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
"name": "bondClaim";
|
|
24
|
+
"docs": [
|
|
25
|
+
"Claims compensation for a validator.",
|
|
26
|
+
"Transfers funds from the validator's bond account to reserve.",
|
|
27
|
+
"",
|
|
28
|
+
"# Arguments",
|
|
29
|
+
"* `amount` - Amount of compensation to claim (must be positive).",
|
|
30
|
+
"",
|
|
31
|
+
"# Errors",
|
|
32
|
+
"Fails if the authority is invalid, if the validator is not active,",
|
|
33
|
+
"if the amount is zero, or if there are insufficient funds."
|
|
34
34
|
];
|
|
35
|
-
discriminator: [
|
|
35
|
+
"discriminator": [
|
|
36
36
|
151,
|
|
37
37
|
92,
|
|
38
38
|
10,
|
|
@@ -42,19 +42,19 @@ type Jbond = {
|
|
|
42
42
|
188,
|
|
43
43
|
129
|
|
44
44
|
];
|
|
45
|
-
accounts: [
|
|
45
|
+
"accounts": [
|
|
46
46
|
{
|
|
47
|
-
name:
|
|
48
|
-
writable: true;
|
|
47
|
+
"name": "bondState";
|
|
48
|
+
"writable": true;
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
|
-
name:
|
|
52
|
-
writable: true;
|
|
53
|
-
pda: {
|
|
54
|
-
seeds: [
|
|
51
|
+
"name": "validatorBond";
|
|
52
|
+
"writable": true;
|
|
53
|
+
"pda": {
|
|
54
|
+
"seeds": [
|
|
55
55
|
{
|
|
56
|
-
kind:
|
|
57
|
-
value: [
|
|
56
|
+
"kind": "const";
|
|
57
|
+
"value": [
|
|
58
58
|
118,
|
|
59
59
|
97,
|
|
60
60
|
108,
|
|
@@ -72,68 +72,68 @@ type Jbond = {
|
|
|
72
72
|
];
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
|
-
kind:
|
|
76
|
-
path:
|
|
75
|
+
"kind": "account";
|
|
76
|
+
"path": "bondState";
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
|
-
kind:
|
|
80
|
-
path:
|
|
81
|
-
account:
|
|
79
|
+
"kind": "account";
|
|
80
|
+
"path": "validator_bond.vote_account";
|
|
81
|
+
"account": "validatorBond";
|
|
82
82
|
}
|
|
83
83
|
];
|
|
84
84
|
};
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
|
-
name:
|
|
88
|
-
writable: true;
|
|
87
|
+
"name": "reserve";
|
|
88
|
+
"writable": true;
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
|
-
name:
|
|
92
|
-
signer: true;
|
|
91
|
+
"name": "authority";
|
|
92
|
+
"signer": true;
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
|
-
name:
|
|
96
|
-
writable: true;
|
|
97
|
-
optional: true;
|
|
95
|
+
"name": "bondTokenAccount";
|
|
96
|
+
"writable": true;
|
|
97
|
+
"optional": true;
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
|
-
name:
|
|
101
|
-
writable: true;
|
|
102
|
-
optional: true;
|
|
100
|
+
"name": "reserveTokenAccount";
|
|
101
|
+
"writable": true;
|
|
102
|
+
"optional": true;
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
|
-
name:
|
|
106
|
-
writable: true;
|
|
107
|
-
optional: true;
|
|
105
|
+
"name": "stakeAccount";
|
|
106
|
+
"writable": true;
|
|
107
|
+
"optional": true;
|
|
108
108
|
},
|
|
109
109
|
{
|
|
110
|
-
name:
|
|
111
|
-
address:
|
|
110
|
+
"name": "systemProgram";
|
|
111
|
+
"address": "11111111111111111111111111111111";
|
|
112
112
|
},
|
|
113
113
|
{
|
|
114
|
-
name:
|
|
115
|
-
optional: true;
|
|
116
|
-
address:
|
|
114
|
+
"name": "tokenProgram";
|
|
115
|
+
"optional": true;
|
|
116
|
+
"address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
|
-
name:
|
|
120
|
-
optional: true;
|
|
119
|
+
"name": "stakeProgram";
|
|
120
|
+
"optional": true;
|
|
121
121
|
}
|
|
122
122
|
];
|
|
123
|
-
args: [
|
|
123
|
+
"args": [
|
|
124
124
|
{
|
|
125
|
-
name:
|
|
126
|
-
type:
|
|
125
|
+
"name": "amount";
|
|
126
|
+
"type": "u64";
|
|
127
127
|
}
|
|
128
128
|
];
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
|
-
name:
|
|
132
|
-
docs: [
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
"name": "bondConfigure";
|
|
132
|
+
"docs": [
|
|
133
|
+
"Updates bond configuration, including authority and reserve fields.",
|
|
134
|
+
"Allows changing the bond's authority and updating the reserve account."
|
|
135
135
|
];
|
|
136
|
-
discriminator: [
|
|
136
|
+
"discriminator": [
|
|
137
137
|
61,
|
|
138
138
|
42,
|
|
139
139
|
106,
|
|
@@ -143,41 +143,41 @@ type Jbond = {
|
|
|
143
143
|
65,
|
|
144
144
|
20
|
|
145
145
|
];
|
|
146
|
-
accounts: [
|
|
146
|
+
"accounts": [
|
|
147
147
|
{
|
|
148
|
-
name:
|
|
149
|
-
writable: true;
|
|
148
|
+
"name": "bondState";
|
|
149
|
+
"writable": true;
|
|
150
150
|
},
|
|
151
151
|
{
|
|
152
|
-
name:
|
|
153
|
-
signer: true;
|
|
154
|
-
relations: [
|
|
155
|
-
|
|
152
|
+
"name": "authority";
|
|
153
|
+
"signer": true;
|
|
154
|
+
"relations": [
|
|
155
|
+
"bondState"
|
|
156
156
|
];
|
|
157
157
|
}
|
|
158
158
|
];
|
|
159
|
-
args: [
|
|
159
|
+
"args": [
|
|
160
160
|
{
|
|
161
|
-
name:
|
|
162
|
-
type: {
|
|
163
|
-
defined: {
|
|
164
|
-
name:
|
|
161
|
+
"name": "data";
|
|
162
|
+
"type": {
|
|
163
|
+
"defined": {
|
|
164
|
+
"name": "bondConfigureData";
|
|
165
165
|
};
|
|
166
166
|
};
|
|
167
167
|
}
|
|
168
168
|
];
|
|
169
169
|
},
|
|
170
170
|
{
|
|
171
|
-
name:
|
|
172
|
-
docs: [
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
171
|
+
"name": "bondInitialize";
|
|
172
|
+
"docs": [
|
|
173
|
+
"Initializes state for the bond.",
|
|
174
|
+
"Sets the authority and reserve account for managing validator bonds.",
|
|
175
|
+
"",
|
|
176
|
+
"# Errors",
|
|
177
|
+
"Fails if the global state account is already initialized or if the payer lacks",
|
|
178
|
+
"sufficient funds."
|
|
179
179
|
];
|
|
180
|
-
discriminator: [
|
|
180
|
+
"discriminator": [
|
|
181
181
|
230,
|
|
182
182
|
3,
|
|
183
183
|
121,
|
|
@@ -187,15 +187,15 @@ type Jbond = {
|
|
|
187
187
|
175,
|
|
188
188
|
210
|
|
189
189
|
];
|
|
190
|
-
accounts: [
|
|
190
|
+
"accounts": [
|
|
191
191
|
{
|
|
192
|
-
name:
|
|
193
|
-
writable: true;
|
|
194
|
-
pda: {
|
|
195
|
-
seeds: [
|
|
192
|
+
"name": "bondState";
|
|
193
|
+
"writable": true;
|
|
194
|
+
"pda": {
|
|
195
|
+
"seeds": [
|
|
196
196
|
{
|
|
197
|
-
kind:
|
|
198
|
-
value: [
|
|
197
|
+
"kind": "const";
|
|
198
|
+
"value": [
|
|
199
199
|
98,
|
|
200
200
|
111,
|
|
201
201
|
110,
|
|
@@ -209,72 +209,72 @@ type Jbond = {
|
|
|
209
209
|
];
|
|
210
210
|
},
|
|
211
211
|
{
|
|
212
|
-
kind:
|
|
213
|
-
path:
|
|
212
|
+
"kind": "arg";
|
|
213
|
+
"path": "data.bond_type";
|
|
214
214
|
},
|
|
215
215
|
{
|
|
216
|
-
kind:
|
|
217
|
-
path:
|
|
216
|
+
"kind": "arg";
|
|
217
|
+
"path": "data.name";
|
|
218
218
|
}
|
|
219
219
|
];
|
|
220
220
|
};
|
|
221
221
|
},
|
|
222
222
|
{
|
|
223
|
-
name:
|
|
224
|
-
writable: true;
|
|
225
|
-
signer: true;
|
|
223
|
+
"name": "authority";
|
|
224
|
+
"writable": true;
|
|
225
|
+
"signer": true;
|
|
226
226
|
},
|
|
227
227
|
{
|
|
228
|
-
name:
|
|
228
|
+
"name": "reserve";
|
|
229
229
|
},
|
|
230
230
|
{
|
|
231
|
-
name:
|
|
232
|
-
address:
|
|
231
|
+
"name": "associatedTokenProgram";
|
|
232
|
+
"address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
233
233
|
},
|
|
234
234
|
{
|
|
235
|
-
name:
|
|
236
|
-
address:
|
|
235
|
+
"name": "systemProgram";
|
|
236
|
+
"address": "11111111111111111111111111111111";
|
|
237
237
|
},
|
|
238
238
|
{
|
|
239
|
-
name:
|
|
240
|
-
address:
|
|
239
|
+
"name": "tokenProgram";
|
|
240
|
+
"address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
241
241
|
},
|
|
242
242
|
{
|
|
243
|
-
name:
|
|
244
|
-
writable: true;
|
|
245
|
-
optional: true;
|
|
243
|
+
"name": "reserveTokenAccount";
|
|
244
|
+
"writable": true;
|
|
245
|
+
"optional": true;
|
|
246
246
|
},
|
|
247
247
|
{
|
|
248
|
-
name:
|
|
249
|
-
optional: true;
|
|
248
|
+
"name": "mint";
|
|
249
|
+
"optional": true;
|
|
250
250
|
}
|
|
251
251
|
];
|
|
252
|
-
args: [
|
|
252
|
+
"args": [
|
|
253
253
|
{
|
|
254
|
-
name:
|
|
255
|
-
type: {
|
|
256
|
-
defined: {
|
|
257
|
-
name:
|
|
254
|
+
"name": "data";
|
|
255
|
+
"type": {
|
|
256
|
+
"defined": {
|
|
257
|
+
"name": "bondInitializeData";
|
|
258
258
|
};
|
|
259
259
|
};
|
|
260
260
|
}
|
|
261
261
|
];
|
|
262
262
|
},
|
|
263
263
|
{
|
|
264
|
-
name:
|
|
265
|
-
docs: [
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
264
|
+
"name": "bondRegister";
|
|
265
|
+
"docs": [
|
|
266
|
+
"Registers a new validator with the bond.",
|
|
267
|
+
"Sets up the validator's bond account and deposits initial collateral.",
|
|
268
|
+
"",
|
|
269
|
+
"# Arguments",
|
|
270
|
+
"* `initial_collateral` - Amount of collateral to lock (must be positive).",
|
|
271
|
+
"* `withdrawal_authority` - Optional key that can withdraw collateral later.",
|
|
272
|
+
"",
|
|
273
|
+
"# Errors",
|
|
274
|
+
"Fails if the validator is already registered, if the vote account is invalid,",
|
|
275
|
+
"or if the initial collateral transfer fails."
|
|
276
276
|
];
|
|
277
|
-
discriminator: [
|
|
277
|
+
"discriminator": [
|
|
278
278
|
117,
|
|
279
279
|
127,
|
|
280
280
|
78,
|
|
@@ -284,19 +284,19 @@ type Jbond = {
|
|
|
284
284
|
163,
|
|
285
285
|
83
|
|
286
286
|
];
|
|
287
|
-
accounts: [
|
|
287
|
+
"accounts": [
|
|
288
288
|
{
|
|
289
|
-
name:
|
|
290
|
-
writable: true;
|
|
289
|
+
"name": "bondState";
|
|
290
|
+
"writable": true;
|
|
291
291
|
},
|
|
292
292
|
{
|
|
293
|
-
name:
|
|
294
|
-
writable: true;
|
|
295
|
-
pda: {
|
|
296
|
-
seeds: [
|
|
293
|
+
"name": "validatorBond";
|
|
294
|
+
"writable": true;
|
|
295
|
+
"pda": {
|
|
296
|
+
"seeds": [
|
|
297
297
|
{
|
|
298
|
-
kind:
|
|
299
|
-
value: [
|
|
298
|
+
"kind": "const";
|
|
299
|
+
"value": [
|
|
300
300
|
118,
|
|
301
301
|
97,
|
|
302
302
|
108,
|
|
@@ -314,78 +314,78 @@ type Jbond = {
|
|
|
314
314
|
];
|
|
315
315
|
},
|
|
316
316
|
{
|
|
317
|
-
kind:
|
|
318
|
-
path:
|
|
317
|
+
"kind": "account";
|
|
318
|
+
"path": "bondState";
|
|
319
319
|
},
|
|
320
320
|
{
|
|
321
|
-
kind:
|
|
322
|
-
path:
|
|
321
|
+
"kind": "account";
|
|
322
|
+
"path": "voteAccount";
|
|
323
323
|
}
|
|
324
324
|
];
|
|
325
325
|
};
|
|
326
326
|
},
|
|
327
327
|
{
|
|
328
|
-
name:
|
|
328
|
+
"name": "identity";
|
|
329
329
|
},
|
|
330
330
|
{
|
|
331
|
-
name:
|
|
331
|
+
"name": "voteAccount";
|
|
332
332
|
},
|
|
333
333
|
{
|
|
334
|
-
name:
|
|
335
|
-
writable: true;
|
|
336
|
-
signer: true;
|
|
334
|
+
"name": "creator";
|
|
335
|
+
"writable": true;
|
|
336
|
+
"signer": true;
|
|
337
337
|
},
|
|
338
338
|
{
|
|
339
|
-
name:
|
|
340
|
-
address:
|
|
339
|
+
"name": "systemProgram";
|
|
340
|
+
"address": "11111111111111111111111111111111";
|
|
341
341
|
},
|
|
342
342
|
{
|
|
343
|
-
name:
|
|
344
|
-
address:
|
|
343
|
+
"name": "tokenProgram";
|
|
344
|
+
"address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
345
345
|
},
|
|
346
346
|
{
|
|
347
|
-
name:
|
|
348
|
-
address:
|
|
347
|
+
"name": "associatedTokenProgram";
|
|
348
|
+
"address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
349
349
|
},
|
|
350
350
|
{
|
|
351
|
-
name:
|
|
352
|
-
writable: true;
|
|
353
|
-
optional: true;
|
|
351
|
+
"name": "bondTokenAccount";
|
|
352
|
+
"writable": true;
|
|
353
|
+
"optional": true;
|
|
354
354
|
},
|
|
355
355
|
{
|
|
356
|
-
name:
|
|
357
|
-
optional: true;
|
|
356
|
+
"name": "mint";
|
|
357
|
+
"optional": true;
|
|
358
358
|
}
|
|
359
359
|
];
|
|
360
|
-
args: [
|
|
360
|
+
"args": [
|
|
361
361
|
{
|
|
362
|
-
name:
|
|
363
|
-
type: {
|
|
364
|
-
defined: {
|
|
365
|
-
name:
|
|
362
|
+
"name": "bondType";
|
|
363
|
+
"type": {
|
|
364
|
+
"defined": {
|
|
365
|
+
"name": "bondType";
|
|
366
366
|
};
|
|
367
367
|
};
|
|
368
368
|
},
|
|
369
369
|
{
|
|
370
|
-
name:
|
|
371
|
-
type:
|
|
370
|
+
"name": "bondName";
|
|
371
|
+
"type": "string";
|
|
372
372
|
}
|
|
373
373
|
];
|
|
374
374
|
},
|
|
375
375
|
{
|
|
376
|
-
name:
|
|
377
|
-
docs: [
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
376
|
+
"name": "bondSetWithdrawAuthority";
|
|
377
|
+
"docs": [
|
|
378
|
+
"Sets a new withdrawal authority for a validator's bond account.",
|
|
379
|
+
"Allows changing who can withdraw collateral in the future.",
|
|
380
|
+
"",
|
|
381
|
+
"# Arguments",
|
|
382
|
+
"* `new_withdraw_authority` - Optional new withdrawal authority key (None to restrict to",
|
|
383
|
+
"identity).",
|
|
384
|
+
"",
|
|
385
|
+
"# Errors",
|
|
386
|
+
"Fails if the signer is not authorized to change the withdrawal authority."
|
|
387
387
|
];
|
|
388
|
-
discriminator: [
|
|
388
|
+
"discriminator": [
|
|
389
389
|
212,
|
|
390
390
|
162,
|
|
391
391
|
53,
|
|
@@ -395,18 +395,18 @@ type Jbond = {
|
|
|
395
395
|
61,
|
|
396
396
|
166
|
|
397
397
|
];
|
|
398
|
-
accounts: [
|
|
398
|
+
"accounts": [
|
|
399
399
|
{
|
|
400
|
-
name:
|
|
400
|
+
"name": "bondState";
|
|
401
401
|
},
|
|
402
402
|
{
|
|
403
|
-
name:
|
|
404
|
-
writable: true;
|
|
405
|
-
pda: {
|
|
406
|
-
seeds: [
|
|
403
|
+
"name": "validatorBond";
|
|
404
|
+
"writable": true;
|
|
405
|
+
"pda": {
|
|
406
|
+
"seeds": [
|
|
407
407
|
{
|
|
408
|
-
kind:
|
|
409
|
-
value: [
|
|
408
|
+
"kind": "const";
|
|
409
|
+
"value": [
|
|
410
410
|
118,
|
|
411
411
|
97,
|
|
412
412
|
108,
|
|
@@ -424,42 +424,42 @@ type Jbond = {
|
|
|
424
424
|
];
|
|
425
425
|
},
|
|
426
426
|
{
|
|
427
|
-
kind:
|
|
428
|
-
path:
|
|
427
|
+
"kind": "account";
|
|
428
|
+
"path": "bondState";
|
|
429
429
|
},
|
|
430
430
|
{
|
|
431
|
-
kind:
|
|
432
|
-
path:
|
|
433
|
-
account:
|
|
431
|
+
"kind": "account";
|
|
432
|
+
"path": "validator_bond.vote_account";
|
|
433
|
+
"account": "validatorBond";
|
|
434
434
|
}
|
|
435
435
|
];
|
|
436
436
|
};
|
|
437
437
|
},
|
|
438
438
|
{
|
|
439
|
-
name:
|
|
440
|
-
signer: true;
|
|
439
|
+
"name": "identity";
|
|
440
|
+
"signer": true;
|
|
441
441
|
},
|
|
442
442
|
{
|
|
443
|
-
name:
|
|
444
|
-
optional: true;
|
|
443
|
+
"name": "newWithdrawAuthority";
|
|
444
|
+
"optional": true;
|
|
445
445
|
}
|
|
446
446
|
];
|
|
447
|
-
args: [];
|
|
447
|
+
"args": [];
|
|
448
448
|
},
|
|
449
449
|
{
|
|
450
|
-
name:
|
|
451
|
-
docs: [
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
450
|
+
"name": "bondTopUp";
|
|
451
|
+
"docs": [
|
|
452
|
+
"Adds additional collateral to an existing validator's bond.",
|
|
453
|
+
"Increases the collateral balance, enhancing the validator's stake.",
|
|
454
|
+
"",
|
|
455
|
+
"# Arguments",
|
|
456
|
+
"* `amount` - Amount to add.",
|
|
457
|
+
"",
|
|
458
|
+
"# Errors",
|
|
459
|
+
"Fails if the validator is not active, if the amount is zero,",
|
|
460
|
+
"or if the transfer of funds fails."
|
|
461
461
|
];
|
|
462
|
-
discriminator: [
|
|
462
|
+
"discriminator": [
|
|
463
463
|
132,
|
|
464
464
|
225,
|
|
465
465
|
254,
|
|
@@ -469,19 +469,19 @@ type Jbond = {
|
|
|
469
469
|
176,
|
|
470
470
|
66
|
|
471
471
|
];
|
|
472
|
-
accounts: [
|
|
472
|
+
"accounts": [
|
|
473
473
|
{
|
|
474
|
-
name:
|
|
475
|
-
writable: true;
|
|
474
|
+
"name": "bondState";
|
|
475
|
+
"writable": true;
|
|
476
476
|
},
|
|
477
477
|
{
|
|
478
|
-
name:
|
|
479
|
-
writable: true;
|
|
480
|
-
pda: {
|
|
481
|
-
seeds: [
|
|
478
|
+
"name": "validatorBond";
|
|
479
|
+
"writable": true;
|
|
480
|
+
"pda": {
|
|
481
|
+
"seeds": [
|
|
482
482
|
{
|
|
483
|
-
kind:
|
|
484
|
-
value: [
|
|
483
|
+
"kind": "const";
|
|
484
|
+
"value": [
|
|
485
485
|
118,
|
|
486
486
|
97,
|
|
487
487
|
108,
|
|
@@ -499,73 +499,73 @@ type Jbond = {
|
|
|
499
499
|
];
|
|
500
500
|
},
|
|
501
501
|
{
|
|
502
|
-
kind:
|
|
503
|
-
path:
|
|
502
|
+
"kind": "account";
|
|
503
|
+
"path": "bondState";
|
|
504
504
|
},
|
|
505
505
|
{
|
|
506
|
-
kind:
|
|
507
|
-
path:
|
|
508
|
-
account:
|
|
506
|
+
"kind": "account";
|
|
507
|
+
"path": "validator_bond.vote_account";
|
|
508
|
+
"account": "validatorBond";
|
|
509
509
|
}
|
|
510
510
|
];
|
|
511
511
|
};
|
|
512
512
|
},
|
|
513
513
|
{
|
|
514
|
-
name:
|
|
515
|
-
writable: true;
|
|
516
|
-
signer: true;
|
|
514
|
+
"name": "payer";
|
|
515
|
+
"writable": true;
|
|
516
|
+
"signer": true;
|
|
517
517
|
},
|
|
518
518
|
{
|
|
519
|
-
name:
|
|
520
|
-
writable: true;
|
|
521
|
-
optional: true;
|
|
519
|
+
"name": "payerTokenAccount";
|
|
520
|
+
"writable": true;
|
|
521
|
+
"optional": true;
|
|
522
522
|
},
|
|
523
523
|
{
|
|
524
|
-
name:
|
|
525
|
-
writable: true;
|
|
526
|
-
optional: true;
|
|
524
|
+
"name": "bondTokenAccount";
|
|
525
|
+
"writable": true;
|
|
526
|
+
"optional": true;
|
|
527
527
|
},
|
|
528
528
|
{
|
|
529
|
-
name:
|
|
530
|
-
writable: true;
|
|
531
|
-
optional: true;
|
|
529
|
+
"name": "stakeAccount";
|
|
530
|
+
"writable": true;
|
|
531
|
+
"optional": true;
|
|
532
532
|
},
|
|
533
533
|
{
|
|
534
|
-
name:
|
|
535
|
-
address:
|
|
534
|
+
"name": "systemProgram";
|
|
535
|
+
"address": "11111111111111111111111111111111";
|
|
536
536
|
},
|
|
537
537
|
{
|
|
538
|
-
name:
|
|
539
|
-
optional: true;
|
|
540
|
-
address:
|
|
538
|
+
"name": "tokenProgram";
|
|
539
|
+
"optional": true;
|
|
540
|
+
"address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
541
541
|
},
|
|
542
542
|
{
|
|
543
|
-
name:
|
|
544
|
-
optional: true;
|
|
543
|
+
"name": "stakeProgram";
|
|
544
|
+
"optional": true;
|
|
545
545
|
}
|
|
546
546
|
];
|
|
547
|
-
args: [
|
|
547
|
+
"args": [
|
|
548
548
|
{
|
|
549
|
-
name:
|
|
550
|
-
type:
|
|
549
|
+
"name": "amount";
|
|
550
|
+
"type": "u64";
|
|
551
551
|
}
|
|
552
552
|
];
|
|
553
553
|
},
|
|
554
554
|
{
|
|
555
|
-
name:
|
|
556
|
-
docs: [
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
555
|
+
"name": "bondWithdraw";
|
|
556
|
+
"docs": [
|
|
557
|
+
"Withdraws collateral from a validator's bond.",
|
|
558
|
+
"Decreases the collateral balance, allowing the validator to reclaim funds.",
|
|
559
|
+
"",
|
|
560
|
+
"# Arguments",
|
|
561
|
+
"* `amount` - Amount to withdraw (must not exceed available balance).",
|
|
562
|
+
"",
|
|
563
|
+
"# Errors",
|
|
564
|
+
"Fails if the validator is not active, if the amount is zero,",
|
|
565
|
+
"if the withdrawal authority is invalid, or if the withdrawal would",
|
|
566
|
+
"leave insufficient collateral."
|
|
567
567
|
];
|
|
568
|
-
discriminator: [
|
|
568
|
+
"discriminator": [
|
|
569
569
|
99,
|
|
570
570
|
64,
|
|
571
571
|
127,
|
|
@@ -575,19 +575,19 @@ type Jbond = {
|
|
|
575
575
|
70,
|
|
576
576
|
204
|
|
577
577
|
];
|
|
578
|
-
accounts: [
|
|
578
|
+
"accounts": [
|
|
579
579
|
{
|
|
580
|
-
name:
|
|
581
|
-
writable: true;
|
|
580
|
+
"name": "bondState";
|
|
581
|
+
"writable": true;
|
|
582
582
|
},
|
|
583
583
|
{
|
|
584
|
-
name:
|
|
585
|
-
writable: true;
|
|
586
|
-
pda: {
|
|
587
|
-
seeds: [
|
|
584
|
+
"name": "validatorBond";
|
|
585
|
+
"writable": true;
|
|
586
|
+
"pda": {
|
|
587
|
+
"seeds": [
|
|
588
588
|
{
|
|
589
|
-
kind:
|
|
590
|
-
value: [
|
|
589
|
+
"kind": "const";
|
|
590
|
+
"value": [
|
|
591
591
|
118,
|
|
592
592
|
97,
|
|
593
593
|
108,
|
|
@@ -605,65 +605,65 @@ type Jbond = {
|
|
|
605
605
|
];
|
|
606
606
|
},
|
|
607
607
|
{
|
|
608
|
-
kind:
|
|
609
|
-
path:
|
|
608
|
+
"kind": "account";
|
|
609
|
+
"path": "bondState";
|
|
610
610
|
},
|
|
611
611
|
{
|
|
612
|
-
kind:
|
|
613
|
-
path:
|
|
614
|
-
account:
|
|
612
|
+
"kind": "account";
|
|
613
|
+
"path": "validator_bond.vote_account";
|
|
614
|
+
"account": "validatorBond";
|
|
615
615
|
}
|
|
616
616
|
];
|
|
617
617
|
};
|
|
618
618
|
},
|
|
619
619
|
{
|
|
620
|
-
name:
|
|
621
|
-
writable: true;
|
|
622
|
-
signer: true;
|
|
620
|
+
"name": "withdrawalAuthority";
|
|
621
|
+
"writable": true;
|
|
622
|
+
"signer": true;
|
|
623
623
|
},
|
|
624
624
|
{
|
|
625
|
-
name:
|
|
626
|
-
writable: true;
|
|
625
|
+
"name": "destination";
|
|
626
|
+
"writable": true;
|
|
627
627
|
},
|
|
628
628
|
{
|
|
629
|
-
name:
|
|
630
|
-
writable: true;
|
|
631
|
-
optional: true;
|
|
629
|
+
"name": "destinationTokenAccount";
|
|
630
|
+
"writable": true;
|
|
631
|
+
"optional": true;
|
|
632
632
|
},
|
|
633
633
|
{
|
|
634
|
-
name:
|
|
635
|
-
writable: true;
|
|
636
|
-
optional: true;
|
|
634
|
+
"name": "bondTokenAccount";
|
|
635
|
+
"writable": true;
|
|
636
|
+
"optional": true;
|
|
637
637
|
},
|
|
638
638
|
{
|
|
639
|
-
name:
|
|
640
|
-
writable: true;
|
|
641
|
-
optional: true;
|
|
639
|
+
"name": "stakeAccount";
|
|
640
|
+
"writable": true;
|
|
641
|
+
"optional": true;
|
|
642
642
|
},
|
|
643
643
|
{
|
|
644
|
-
name:
|
|
645
|
-
address:
|
|
644
|
+
"name": "systemProgram";
|
|
645
|
+
"address": "11111111111111111111111111111111";
|
|
646
646
|
},
|
|
647
647
|
{
|
|
648
|
-
name:
|
|
649
|
-
optional: true;
|
|
650
|
-
address:
|
|
648
|
+
"name": "tokenProgram";
|
|
649
|
+
"optional": true;
|
|
650
|
+
"address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
651
651
|
},
|
|
652
652
|
{
|
|
653
|
-
name:
|
|
654
|
-
optional: true;
|
|
653
|
+
"name": "stakeProgram";
|
|
654
|
+
"optional": true;
|
|
655
655
|
}
|
|
656
656
|
];
|
|
657
|
-
args: [
|
|
657
|
+
"args": [
|
|
658
658
|
{
|
|
659
|
-
name:
|
|
660
|
-
type:
|
|
659
|
+
"name": "amount";
|
|
660
|
+
"type": "u64";
|
|
661
661
|
}
|
|
662
662
|
];
|
|
663
663
|
},
|
|
664
664
|
{
|
|
665
|
-
name:
|
|
666
|
-
discriminator: [
|
|
665
|
+
"name": "globalConfigure";
|
|
666
|
+
"discriminator": [
|
|
667
667
|
67,
|
|
668
668
|
142,
|
|
669
669
|
164,
|
|
@@ -673,15 +673,15 @@ type Jbond = {
|
|
|
673
673
|
144,
|
|
674
674
|
187
|
|
675
675
|
];
|
|
676
|
-
accounts: [
|
|
676
|
+
"accounts": [
|
|
677
677
|
{
|
|
678
|
-
name:
|
|
679
|
-
writable: true;
|
|
680
|
-
pda: {
|
|
681
|
-
seeds: [
|
|
678
|
+
"name": "globalState";
|
|
679
|
+
"writable": true;
|
|
680
|
+
"pda": {
|
|
681
|
+
"seeds": [
|
|
682
682
|
{
|
|
683
|
-
kind:
|
|
684
|
-
value: [
|
|
683
|
+
"kind": "const";
|
|
684
|
+
"value": [
|
|
685
685
|
103,
|
|
686
686
|
108,
|
|
687
687
|
111,
|
|
@@ -700,27 +700,27 @@ type Jbond = {
|
|
|
700
700
|
};
|
|
701
701
|
},
|
|
702
702
|
{
|
|
703
|
-
name:
|
|
704
|
-
signer: true;
|
|
705
|
-
relations: [
|
|
706
|
-
|
|
703
|
+
"name": "authority";
|
|
704
|
+
"signer": true;
|
|
705
|
+
"relations": [
|
|
706
|
+
"globalState"
|
|
707
707
|
];
|
|
708
708
|
}
|
|
709
709
|
];
|
|
710
|
-
args: [
|
|
710
|
+
"args": [
|
|
711
711
|
{
|
|
712
|
-
name:
|
|
713
|
-
type: {
|
|
714
|
-
defined: {
|
|
715
|
-
name:
|
|
712
|
+
"name": "data";
|
|
713
|
+
"type": {
|
|
714
|
+
"defined": {
|
|
715
|
+
"name": "globalConfigureData";
|
|
716
716
|
};
|
|
717
717
|
};
|
|
718
718
|
}
|
|
719
719
|
];
|
|
720
720
|
},
|
|
721
721
|
{
|
|
722
|
-
name:
|
|
723
|
-
discriminator: [
|
|
722
|
+
"name": "globalInitialize";
|
|
723
|
+
"discriminator": [
|
|
724
724
|
30,
|
|
725
725
|
79,
|
|
726
726
|
193,
|
|
@@ -730,15 +730,15 @@ type Jbond = {
|
|
|
730
730
|
223,
|
|
731
731
|
196
|
|
732
732
|
];
|
|
733
|
-
accounts: [
|
|
733
|
+
"accounts": [
|
|
734
734
|
{
|
|
735
|
-
name:
|
|
736
|
-
writable: true;
|
|
737
|
-
pda: {
|
|
738
|
-
seeds: [
|
|
735
|
+
"name": "globalState";
|
|
736
|
+
"writable": true;
|
|
737
|
+
"pda": {
|
|
738
|
+
"seeds": [
|
|
739
739
|
{
|
|
740
|
-
kind:
|
|
741
|
-
value: [
|
|
740
|
+
"kind": "const";
|
|
741
|
+
"value": [
|
|
742
742
|
103,
|
|
743
743
|
108,
|
|
744
744
|
111,
|
|
@@ -757,23 +757,23 @@ type Jbond = {
|
|
|
757
757
|
};
|
|
758
758
|
},
|
|
759
759
|
{
|
|
760
|
-
name:
|
|
761
|
-
writable: true;
|
|
762
|
-
signer: true;
|
|
760
|
+
"name": "authority";
|
|
761
|
+
"writable": true;
|
|
762
|
+
"signer": true;
|
|
763
763
|
},
|
|
764
764
|
{
|
|
765
|
-
name:
|
|
766
|
-
address:
|
|
765
|
+
"name": "systemProgram";
|
|
766
|
+
"address": "11111111111111111111111111111111";
|
|
767
767
|
}
|
|
768
768
|
];
|
|
769
|
-
args: [];
|
|
769
|
+
"args": [];
|
|
770
770
|
},
|
|
771
771
|
{
|
|
772
|
-
name:
|
|
773
|
-
docs: [
|
|
774
|
-
|
|
772
|
+
"name": "migrateBond";
|
|
773
|
+
"docs": [
|
|
774
|
+
"Migrates validator bond data from legacy structure to new structure."
|
|
775
775
|
];
|
|
776
|
-
discriminator: [
|
|
776
|
+
"discriminator": [
|
|
777
777
|
107,
|
|
778
778
|
119,
|
|
779
779
|
59,
|
|
@@ -783,26 +783,26 @@ type Jbond = {
|
|
|
783
783
|
37,
|
|
784
784
|
163
|
|
785
785
|
];
|
|
786
|
-
accounts: [
|
|
786
|
+
"accounts": [
|
|
787
787
|
{
|
|
788
|
-
name:
|
|
789
|
-
writable: true;
|
|
788
|
+
"name": "bondState";
|
|
789
|
+
"writable": true;
|
|
790
790
|
},
|
|
791
791
|
{
|
|
792
|
-
name:
|
|
793
|
-
writable: true;
|
|
792
|
+
"name": "legacyValidatorBond";
|
|
793
|
+
"writable": true;
|
|
794
794
|
},
|
|
795
795
|
{
|
|
796
|
-
name:
|
|
796
|
+
"name": "legacyVoteAccount";
|
|
797
797
|
},
|
|
798
798
|
{
|
|
799
|
-
name:
|
|
800
|
-
writable: true;
|
|
801
|
-
pda: {
|
|
802
|
-
seeds: [
|
|
799
|
+
"name": "validatorBond";
|
|
800
|
+
"writable": true;
|
|
801
|
+
"pda": {
|
|
802
|
+
"seeds": [
|
|
803
803
|
{
|
|
804
|
-
kind:
|
|
805
|
-
value: [
|
|
804
|
+
"kind": "const";
|
|
805
|
+
"value": [
|
|
806
806
|
118,
|
|
807
807
|
97,
|
|
808
808
|
108,
|
|
@@ -820,34 +820,34 @@ type Jbond = {
|
|
|
820
820
|
];
|
|
821
821
|
},
|
|
822
822
|
{
|
|
823
|
-
kind:
|
|
824
|
-
path:
|
|
823
|
+
"kind": "account";
|
|
824
|
+
"path": "bondState";
|
|
825
825
|
},
|
|
826
826
|
{
|
|
827
|
-
kind:
|
|
828
|
-
path:
|
|
827
|
+
"kind": "account";
|
|
828
|
+
"path": "legacyVoteAccount";
|
|
829
829
|
}
|
|
830
830
|
];
|
|
831
831
|
};
|
|
832
832
|
},
|
|
833
833
|
{
|
|
834
|
-
name:
|
|
835
|
-
writable: true;
|
|
836
|
-
signer: true;
|
|
834
|
+
"name": "creator";
|
|
835
|
+
"writable": true;
|
|
836
|
+
"signer": true;
|
|
837
837
|
},
|
|
838
838
|
{
|
|
839
|
-
name:
|
|
840
|
-
address:
|
|
839
|
+
"name": "systemProgram";
|
|
840
|
+
"address": "11111111111111111111111111111111";
|
|
841
841
|
}
|
|
842
842
|
];
|
|
843
|
-
args: [];
|
|
843
|
+
"args": [];
|
|
844
844
|
},
|
|
845
845
|
{
|
|
846
|
-
name:
|
|
847
|
-
docs: [
|
|
848
|
-
|
|
846
|
+
"name": "sessionFinish";
|
|
847
|
+
"docs": [
|
|
848
|
+
"Finishes a bond, preventing further deposits and withdrawals."
|
|
849
849
|
];
|
|
850
|
-
discriminator: [
|
|
850
|
+
"discriminator": [
|
|
851
851
|
230,
|
|
852
852
|
209,
|
|
853
853
|
54,
|
|
@@ -857,28 +857,28 @@ type Jbond = {
|
|
|
857
857
|
137,
|
|
858
858
|
113
|
|
859
859
|
];
|
|
860
|
-
accounts: [
|
|
860
|
+
"accounts": [
|
|
861
861
|
{
|
|
862
|
-
name:
|
|
863
|
-
writable: true;
|
|
862
|
+
"name": "bondState";
|
|
863
|
+
"writable": true;
|
|
864
864
|
},
|
|
865
865
|
{
|
|
866
|
-
name:
|
|
867
|
-
writable: true;
|
|
868
|
-
signer: true;
|
|
869
|
-
relations: [
|
|
870
|
-
|
|
866
|
+
"name": "authority";
|
|
867
|
+
"writable": true;
|
|
868
|
+
"signer": true;
|
|
869
|
+
"relations": [
|
|
870
|
+
"bondState"
|
|
871
871
|
];
|
|
872
872
|
}
|
|
873
873
|
];
|
|
874
|
-
args: [];
|
|
874
|
+
"args": [];
|
|
875
875
|
},
|
|
876
876
|
{
|
|
877
|
-
name:
|
|
878
|
-
docs: [
|
|
879
|
-
|
|
877
|
+
"name": "sessionStart";
|
|
878
|
+
"docs": [
|
|
879
|
+
"Starts a paused bond, allowing deposits and withdrawals to resume."
|
|
880
880
|
];
|
|
881
|
-
discriminator: [
|
|
881
|
+
"discriminator": [
|
|
882
882
|
132,
|
|
883
883
|
93,
|
|
884
884
|
83,
|
|
@@ -888,32 +888,32 @@ type Jbond = {
|
|
|
888
888
|
58,
|
|
889
889
|
92
|
|
890
890
|
];
|
|
891
|
-
accounts: [
|
|
891
|
+
"accounts": [
|
|
892
892
|
{
|
|
893
|
-
name:
|
|
894
|
-
writable: true;
|
|
893
|
+
"name": "bondState";
|
|
894
|
+
"writable": true;
|
|
895
895
|
},
|
|
896
896
|
{
|
|
897
|
-
name:
|
|
898
|
-
writable: true;
|
|
899
|
-
signer: true;
|
|
900
|
-
relations: [
|
|
901
|
-
|
|
897
|
+
"name": "authority";
|
|
898
|
+
"writable": true;
|
|
899
|
+
"signer": true;
|
|
900
|
+
"relations": [
|
|
901
|
+
"bondState"
|
|
902
902
|
];
|
|
903
903
|
}
|
|
904
904
|
];
|
|
905
|
-
args: [
|
|
905
|
+
"args": [
|
|
906
906
|
{
|
|
907
|
-
name:
|
|
908
|
-
type:
|
|
907
|
+
"name": "durationSecs";
|
|
908
|
+
"type": "u64";
|
|
909
909
|
}
|
|
910
910
|
];
|
|
911
911
|
}
|
|
912
912
|
];
|
|
913
|
-
accounts: [
|
|
913
|
+
"accounts": [
|
|
914
914
|
{
|
|
915
|
-
name:
|
|
916
|
-
discriminator: [
|
|
915
|
+
"name": "bondState";
|
|
916
|
+
"discriminator": [
|
|
917
917
|
251,
|
|
918
918
|
95,
|
|
919
919
|
76,
|
|
@@ -925,8 +925,8 @@ type Jbond = {
|
|
|
925
925
|
];
|
|
926
926
|
},
|
|
927
927
|
{
|
|
928
|
-
name:
|
|
929
|
-
discriminator: [
|
|
928
|
+
"name": "globalState";
|
|
929
|
+
"discriminator": [
|
|
930
930
|
163,
|
|
931
931
|
46,
|
|
932
932
|
74,
|
|
@@ -938,8 +938,8 @@ type Jbond = {
|
|
|
938
938
|
];
|
|
939
939
|
},
|
|
940
940
|
{
|
|
941
|
-
name:
|
|
942
|
-
discriminator: [
|
|
941
|
+
"name": "validatorBond";
|
|
942
|
+
"discriminator": [
|
|
943
943
|
82,
|
|
944
944
|
127,
|
|
945
945
|
243,
|
|
@@ -951,10 +951,10 @@ type Jbond = {
|
|
|
951
951
|
];
|
|
952
952
|
}
|
|
953
953
|
];
|
|
954
|
-
events: [
|
|
954
|
+
"events": [
|
|
955
955
|
{
|
|
956
|
-
name:
|
|
957
|
-
discriminator: [
|
|
956
|
+
"name": "bondFinished";
|
|
957
|
+
"discriminator": [
|
|
958
958
|
223,
|
|
959
959
|
254,
|
|
960
960
|
3,
|
|
@@ -966,8 +966,8 @@ type Jbond = {
|
|
|
966
966
|
];
|
|
967
967
|
},
|
|
968
968
|
{
|
|
969
|
-
name:
|
|
970
|
-
discriminator: [
|
|
969
|
+
"name": "bondStarted";
|
|
970
|
+
"discriminator": [
|
|
971
971
|
235,
|
|
972
972
|
69,
|
|
973
973
|
80,
|
|
@@ -979,8 +979,8 @@ type Jbond = {
|
|
|
979
979
|
];
|
|
980
980
|
},
|
|
981
981
|
{
|
|
982
|
-
name:
|
|
983
|
-
discriminator: [
|
|
982
|
+
"name": "collateralToppedUp";
|
|
983
|
+
"discriminator": [
|
|
984
984
|
189,
|
|
985
985
|
137,
|
|
986
986
|
204,
|
|
@@ -992,8 +992,8 @@ type Jbond = {
|
|
|
992
992
|
];
|
|
993
993
|
},
|
|
994
994
|
{
|
|
995
|
-
name:
|
|
996
|
-
discriminator: [
|
|
995
|
+
"name": "collateralWithdrawn";
|
|
996
|
+
"discriminator": [
|
|
997
997
|
51,
|
|
998
998
|
224,
|
|
999
999
|
133,
|
|
@@ -1005,8 +1005,8 @@ type Jbond = {
|
|
|
1005
1005
|
];
|
|
1006
1006
|
},
|
|
1007
1007
|
{
|
|
1008
|
-
name:
|
|
1009
|
-
discriminator: [
|
|
1008
|
+
"name": "compensationClaimed";
|
|
1009
|
+
"discriminator": [
|
|
1010
1010
|
36,
|
|
1011
1011
|
159,
|
|
1012
1012
|
41,
|
|
@@ -1018,8 +1018,8 @@ type Jbond = {
|
|
|
1018
1018
|
];
|
|
1019
1019
|
},
|
|
1020
1020
|
{
|
|
1021
|
-
name:
|
|
1022
|
-
discriminator: [
|
|
1021
|
+
"name": "validatorRegistered";
|
|
1022
|
+
"discriminator": [
|
|
1023
1023
|
20,
|
|
1024
1024
|
20,
|
|
1025
1025
|
190,
|
|
@@ -1031,208 +1031,208 @@ type Jbond = {
|
|
|
1031
1031
|
];
|
|
1032
1032
|
}
|
|
1033
1033
|
];
|
|
1034
|
-
errors: [
|
|
1034
|
+
"errors": [
|
|
1035
1035
|
{
|
|
1036
|
-
code: 6000;
|
|
1037
|
-
name:
|
|
1038
|
-
msg:
|
|
1036
|
+
"code": 6000;
|
|
1037
|
+
"name": "invalidVoteAccount";
|
|
1038
|
+
"msg": "Invalid vote account";
|
|
1039
1039
|
},
|
|
1040
1040
|
{
|
|
1041
|
-
code: 6001;
|
|
1042
|
-
name:
|
|
1043
|
-
msg:
|
|
1041
|
+
"code": 6001;
|
|
1042
|
+
"name": "identityMismatch";
|
|
1043
|
+
"msg": "Identity does not match vote account";
|
|
1044
1044
|
},
|
|
1045
1045
|
{
|
|
1046
|
-
code: 6002;
|
|
1047
|
-
name:
|
|
1048
|
-
msg:
|
|
1046
|
+
"code": 6002;
|
|
1047
|
+
"name": "insufficientCollateral";
|
|
1048
|
+
"msg": "Insufficient collateral amount";
|
|
1049
1049
|
},
|
|
1050
1050
|
{
|
|
1051
|
-
code: 6003;
|
|
1052
|
-
name:
|
|
1053
|
-
msg:
|
|
1051
|
+
"code": 6003;
|
|
1052
|
+
"name": "targetAprTooLow";
|
|
1053
|
+
"msg": "Target APR is below minimum threshold";
|
|
1054
1054
|
},
|
|
1055
1055
|
{
|
|
1056
|
-
code: 6004;
|
|
1057
|
-
name:
|
|
1058
|
-
msg:
|
|
1056
|
+
"code": 6004;
|
|
1057
|
+
"name": "mathOverflow";
|
|
1058
|
+
"msg": "Math overflow";
|
|
1059
1059
|
},
|
|
1060
1060
|
{
|
|
1061
|
-
code: 6005;
|
|
1062
|
-
name:
|
|
1063
|
-
msg:
|
|
1061
|
+
"code": 6005;
|
|
1062
|
+
"name": "invalidAmount";
|
|
1063
|
+
"msg": "Invalid amount";
|
|
1064
1064
|
},
|
|
1065
1065
|
{
|
|
1066
|
-
code: 6006;
|
|
1067
|
-
name:
|
|
1068
|
-
msg:
|
|
1066
|
+
"code": 6006;
|
|
1067
|
+
"name": "validatorNotActive";
|
|
1068
|
+
"msg": "Validator bond account is not active";
|
|
1069
1069
|
},
|
|
1070
1070
|
{
|
|
1071
|
-
code: 6007;
|
|
1072
|
-
name:
|
|
1073
|
-
msg:
|
|
1071
|
+
"code": 6007;
|
|
1072
|
+
"name": "validatorAlreadyRegistered";
|
|
1073
|
+
"msg": "Validator already registered";
|
|
1074
1074
|
},
|
|
1075
1075
|
{
|
|
1076
|
-
code: 6008;
|
|
1077
|
-
name:
|
|
1078
|
-
msg:
|
|
1076
|
+
"code": 6008;
|
|
1077
|
+
"name": "unauthorized";
|
|
1078
|
+
"msg": "unauthorized";
|
|
1079
1079
|
},
|
|
1080
1080
|
{
|
|
1081
|
-
code: 6009;
|
|
1082
|
-
name:
|
|
1083
|
-
msg:
|
|
1081
|
+
"code": 6009;
|
|
1082
|
+
"name": "withdrawalLockedNearEpochEnd";
|
|
1083
|
+
"msg": "Withdrawals are locked near the end of the epoch.";
|
|
1084
1084
|
},
|
|
1085
1085
|
{
|
|
1086
|
-
code: 6010;
|
|
1087
|
-
name:
|
|
1088
|
-
msg:
|
|
1086
|
+
"code": 6010;
|
|
1087
|
+
"name": "missingTokenAccounts";
|
|
1088
|
+
"msg": "Missing token accounts for token collateral type";
|
|
1089
1089
|
},
|
|
1090
1090
|
{
|
|
1091
|
-
code: 6011;
|
|
1092
|
-
name:
|
|
1093
|
-
msg:
|
|
1091
|
+
"code": 6011;
|
|
1092
|
+
"name": "missingTokenProgram";
|
|
1093
|
+
"msg": "Token program is required for token collateral type";
|
|
1094
1094
|
},
|
|
1095
1095
|
{
|
|
1096
|
-
code: 6012;
|
|
1097
|
-
name:
|
|
1098
|
-
msg:
|
|
1096
|
+
"code": 6012;
|
|
1097
|
+
"name": "invalidMint";
|
|
1098
|
+
"msg": "Invalid mint for token collateral type";
|
|
1099
1099
|
},
|
|
1100
1100
|
{
|
|
1101
|
-
code: 6013;
|
|
1102
|
-
name:
|
|
1103
|
-
msg:
|
|
1101
|
+
"code": 6013;
|
|
1102
|
+
"name": "missingStakeAccount";
|
|
1103
|
+
"msg": "Stake account is required for stake account collateral type";
|
|
1104
1104
|
},
|
|
1105
1105
|
{
|
|
1106
|
-
code: 6014;
|
|
1107
|
-
name:
|
|
1108
|
-
msg:
|
|
1106
|
+
"code": 6014;
|
|
1107
|
+
"name": "missingStakeProgram";
|
|
1108
|
+
"msg": "Stake program is required for stake account collateral type";
|
|
1109
1109
|
},
|
|
1110
1110
|
{
|
|
1111
|
-
code: 6015;
|
|
1112
|
-
name:
|
|
1113
|
-
msg:
|
|
1111
|
+
"code": 6015;
|
|
1112
|
+
"name": "bondFinished";
|
|
1113
|
+
"msg": "Bond is finished (deposits/withdrawals disabled)";
|
|
1114
1114
|
},
|
|
1115
1115
|
{
|
|
1116
|
-
code: 6016;
|
|
1117
|
-
name:
|
|
1118
|
-
msg:
|
|
1116
|
+
"code": 6016;
|
|
1117
|
+
"name": "bondNotFinished";
|
|
1118
|
+
"msg": "Bond is not finished";
|
|
1119
1119
|
},
|
|
1120
1120
|
{
|
|
1121
|
-
code: 6017;
|
|
1122
|
-
name:
|
|
1123
|
-
msg:
|
|
1121
|
+
"code": 6017;
|
|
1122
|
+
"name": "unsupportedCollateralType";
|
|
1123
|
+
"msg": "Unsupported collateral type";
|
|
1124
1124
|
},
|
|
1125
1125
|
{
|
|
1126
|
-
code: 6018;
|
|
1127
|
-
name:
|
|
1128
|
-
msg:
|
|
1126
|
+
"code": 6018;
|
|
1127
|
+
"name": "overflow";
|
|
1128
|
+
"msg": "Math operation overflowed";
|
|
1129
1129
|
},
|
|
1130
1130
|
{
|
|
1131
|
-
code: 6019;
|
|
1132
|
-
name:
|
|
1133
|
-
msg:
|
|
1131
|
+
"code": 6019;
|
|
1132
|
+
"name": "incorrectBondType";
|
|
1133
|
+
"msg": "Incorrect bond type for this operation";
|
|
1134
1134
|
},
|
|
1135
1135
|
{
|
|
1136
|
-
code: 6020;
|
|
1137
|
-
name:
|
|
1138
|
-
msg:
|
|
1136
|
+
"code": 6020;
|
|
1137
|
+
"name": "bondNotFinishable";
|
|
1138
|
+
"msg": "This bond type can't be finished";
|
|
1139
1139
|
},
|
|
1140
1140
|
{
|
|
1141
|
-
code: 6021;
|
|
1142
|
-
name:
|
|
1143
|
-
msg:
|
|
1141
|
+
"code": 6021;
|
|
1142
|
+
"name": "invalidArgument";
|
|
1143
|
+
"msg": "Invalid argument provided";
|
|
1144
1144
|
},
|
|
1145
1145
|
{
|
|
1146
|
-
code: 6022;
|
|
1147
|
-
name:
|
|
1148
|
-
msg:
|
|
1146
|
+
"code": 6022;
|
|
1147
|
+
"name": "bondNotDisabled";
|
|
1148
|
+
"msg": "Bond is not disabled";
|
|
1149
1149
|
},
|
|
1150
1150
|
{
|
|
1151
|
-
code: 6023;
|
|
1152
|
-
name:
|
|
1153
|
-
msg:
|
|
1151
|
+
"code": 6023;
|
|
1152
|
+
"name": "bondNotEnabled";
|
|
1153
|
+
"msg": "Bond is not enabled";
|
|
1154
1154
|
}
|
|
1155
1155
|
];
|
|
1156
|
-
types: [
|
|
1156
|
+
"types": [
|
|
1157
1157
|
{
|
|
1158
|
-
name:
|
|
1159
|
-
type: {
|
|
1160
|
-
kind:
|
|
1161
|
-
fields: [
|
|
1158
|
+
"name": "bondConfigureData";
|
|
1159
|
+
"type": {
|
|
1160
|
+
"kind": "struct";
|
|
1161
|
+
"fields": [
|
|
1162
1162
|
{
|
|
1163
|
-
name:
|
|
1164
|
-
type: {
|
|
1165
|
-
option: {
|
|
1166
|
-
defined: {
|
|
1167
|
-
name:
|
|
1163
|
+
"name": "status";
|
|
1164
|
+
"type": {
|
|
1165
|
+
"option": {
|
|
1166
|
+
"defined": {
|
|
1167
|
+
"name": "bondStatus";
|
|
1168
1168
|
};
|
|
1169
1169
|
};
|
|
1170
1170
|
};
|
|
1171
1171
|
},
|
|
1172
1172
|
{
|
|
1173
|
-
name:
|
|
1174
|
-
type: {
|
|
1175
|
-
option:
|
|
1173
|
+
"name": "newReserve";
|
|
1174
|
+
"type": {
|
|
1175
|
+
"option": "pubkey";
|
|
1176
1176
|
};
|
|
1177
1177
|
},
|
|
1178
1178
|
{
|
|
1179
|
-
name:
|
|
1180
|
-
type: {
|
|
1181
|
-
option:
|
|
1179
|
+
"name": "newAuthority";
|
|
1180
|
+
"type": {
|
|
1181
|
+
"option": "pubkey";
|
|
1182
1182
|
};
|
|
1183
1183
|
}
|
|
1184
1184
|
];
|
|
1185
1185
|
};
|
|
1186
1186
|
},
|
|
1187
1187
|
{
|
|
1188
|
-
name:
|
|
1189
|
-
type: {
|
|
1190
|
-
kind:
|
|
1191
|
-
fields: [
|
|
1188
|
+
"name": "bondFinished";
|
|
1189
|
+
"type": {
|
|
1190
|
+
"kind": "struct";
|
|
1191
|
+
"fields": [
|
|
1192
1192
|
{
|
|
1193
|
-
name:
|
|
1194
|
-
type:
|
|
1193
|
+
"name": "bond";
|
|
1194
|
+
"type": "pubkey";
|
|
1195
1195
|
},
|
|
1196
1196
|
{
|
|
1197
|
-
name:
|
|
1198
|
-
type:
|
|
1197
|
+
"name": "authority";
|
|
1198
|
+
"type": "pubkey";
|
|
1199
1199
|
},
|
|
1200
1200
|
{
|
|
1201
|
-
name:
|
|
1202
|
-
type:
|
|
1201
|
+
"name": "timestamp";
|
|
1202
|
+
"type": "i64";
|
|
1203
1203
|
}
|
|
1204
1204
|
];
|
|
1205
1205
|
};
|
|
1206
1206
|
},
|
|
1207
1207
|
{
|
|
1208
|
-
name:
|
|
1209
|
-
docs: [
|
|
1210
|
-
|
|
1208
|
+
"name": "bondInitializeData";
|
|
1209
|
+
"docs": [
|
|
1210
|
+
"Data required to initialize a performance bond"
|
|
1211
1211
|
];
|
|
1212
|
-
type: {
|
|
1213
|
-
kind:
|
|
1214
|
-
fields: [
|
|
1212
|
+
"type": {
|
|
1213
|
+
"kind": "struct";
|
|
1214
|
+
"fields": [
|
|
1215
1215
|
{
|
|
1216
|
-
name:
|
|
1217
|
-
type:
|
|
1216
|
+
"name": "name";
|
|
1217
|
+
"type": "string";
|
|
1218
1218
|
},
|
|
1219
1219
|
{
|
|
1220
|
-
name:
|
|
1221
|
-
type: {
|
|
1222
|
-
defined: {
|
|
1223
|
-
name:
|
|
1220
|
+
"name": "bondType";
|
|
1221
|
+
"type": {
|
|
1222
|
+
"defined": {
|
|
1223
|
+
"name": "bondType";
|
|
1224
1224
|
};
|
|
1225
1225
|
};
|
|
1226
1226
|
},
|
|
1227
1227
|
{
|
|
1228
|
-
name:
|
|
1229
|
-
type:
|
|
1228
|
+
"name": "reserve";
|
|
1229
|
+
"type": "pubkey";
|
|
1230
1230
|
},
|
|
1231
1231
|
{
|
|
1232
|
-
name:
|
|
1233
|
-
type: {
|
|
1234
|
-
defined: {
|
|
1235
|
-
name:
|
|
1232
|
+
"name": "collateralType";
|
|
1233
|
+
"type": {
|
|
1234
|
+
"defined": {
|
|
1235
|
+
"name": "collateralType";
|
|
1236
1236
|
};
|
|
1237
1237
|
};
|
|
1238
1238
|
}
|
|
@@ -1240,359 +1240,381 @@ type Jbond = {
|
|
|
1240
1240
|
};
|
|
1241
1241
|
},
|
|
1242
1242
|
{
|
|
1243
|
-
name:
|
|
1244
|
-
type: {
|
|
1245
|
-
kind:
|
|
1246
|
-
fields: [
|
|
1243
|
+
"name": "bondStarted";
|
|
1244
|
+
"type": {
|
|
1245
|
+
"kind": "struct";
|
|
1246
|
+
"fields": [
|
|
1247
1247
|
{
|
|
1248
|
-
name:
|
|
1249
|
-
type:
|
|
1248
|
+
"name": "bond";
|
|
1249
|
+
"type": "pubkey";
|
|
1250
1250
|
},
|
|
1251
1251
|
{
|
|
1252
|
-
name:
|
|
1253
|
-
type:
|
|
1252
|
+
"name": "authority";
|
|
1253
|
+
"type": "pubkey";
|
|
1254
1254
|
},
|
|
1255
1255
|
{
|
|
1256
|
-
name:
|
|
1257
|
-
type:
|
|
1256
|
+
"name": "timestamp";
|
|
1257
|
+
"type": "i64";
|
|
1258
1258
|
}
|
|
1259
1259
|
];
|
|
1260
1260
|
};
|
|
1261
1261
|
},
|
|
1262
1262
|
{
|
|
1263
|
-
name:
|
|
1264
|
-
type: {
|
|
1265
|
-
kind:
|
|
1266
|
-
fields: [
|
|
1263
|
+
"name": "bondState";
|
|
1264
|
+
"type": {
|
|
1265
|
+
"kind": "struct";
|
|
1266
|
+
"fields": [
|
|
1267
1267
|
{
|
|
1268
|
-
name:
|
|
1269
|
-
type:
|
|
1268
|
+
"name": "name";
|
|
1269
|
+
"type": "string";
|
|
1270
1270
|
},
|
|
1271
1271
|
{
|
|
1272
|
-
name:
|
|
1273
|
-
docs: [
|
|
1274
|
-
|
|
1272
|
+
"name": "bondType";
|
|
1273
|
+
"docs": [
|
|
1274
|
+
"The type of bond (e.g., Standard, Crowdfunding)"
|
|
1275
1275
|
];
|
|
1276
|
-
type: {
|
|
1277
|
-
defined: {
|
|
1278
|
-
name:
|
|
1276
|
+
"type": {
|
|
1277
|
+
"defined": {
|
|
1278
|
+
"name": "bondType";
|
|
1279
1279
|
};
|
|
1280
1280
|
};
|
|
1281
1281
|
},
|
|
1282
1282
|
{
|
|
1283
|
-
name:
|
|
1284
|
-
docs: [
|
|
1285
|
-
|
|
1283
|
+
"name": "collateralType";
|
|
1284
|
+
"docs": [
|
|
1285
|
+
"The type of collateral accepted for this bond"
|
|
1286
1286
|
];
|
|
1287
|
-
type: {
|
|
1288
|
-
defined: {
|
|
1289
|
-
name:
|
|
1287
|
+
"type": {
|
|
1288
|
+
"defined": {
|
|
1289
|
+
"name": "collateralType";
|
|
1290
1290
|
};
|
|
1291
1291
|
};
|
|
1292
1292
|
},
|
|
1293
1293
|
{
|
|
1294
|
-
name:
|
|
1295
|
-
docs: [
|
|
1296
|
-
|
|
1294
|
+
"name": "reserve";
|
|
1295
|
+
"docs": [
|
|
1296
|
+
"Reserve account where collateral is held"
|
|
1297
1297
|
];
|
|
1298
|
-
type:
|
|
1298
|
+
"type": "pubkey";
|
|
1299
1299
|
},
|
|
1300
1300
|
{
|
|
1301
|
-
name:
|
|
1302
|
-
docs: [
|
|
1303
|
-
|
|
1301
|
+
"name": "authority";
|
|
1302
|
+
"docs": [
|
|
1303
|
+
"Authority allowed to manage the bond configuration"
|
|
1304
1304
|
];
|
|
1305
|
-
type:
|
|
1305
|
+
"type": "pubkey";
|
|
1306
1306
|
},
|
|
1307
1307
|
{
|
|
1308
|
-
name:
|
|
1309
|
-
docs: [
|
|
1310
|
-
|
|
1308
|
+
"name": "sessionId";
|
|
1309
|
+
"docs": [
|
|
1310
|
+
"Unique identifier for the bonding session"
|
|
1311
1311
|
];
|
|
1312
|
-
type:
|
|
1312
|
+
"type": "u32";
|
|
1313
1313
|
},
|
|
1314
1314
|
{
|
|
1315
|
-
name:
|
|
1316
|
-
docs: [
|
|
1317
|
-
|
|
1315
|
+
"name": "totalMembers";
|
|
1316
|
+
"docs": [
|
|
1317
|
+
"Total number of users who have participated in the bond"
|
|
1318
1318
|
];
|
|
1319
|
-
type:
|
|
1319
|
+
"type": "u16";
|
|
1320
1320
|
},
|
|
1321
1321
|
{
|
|
1322
|
-
name:
|
|
1323
|
-
docs: [
|
|
1324
|
-
|
|
1322
|
+
"name": "totalCompensationAmount";
|
|
1323
|
+
"docs": [
|
|
1324
|
+
"Total compensation amount paid out"
|
|
1325
1325
|
];
|
|
1326
|
-
type:
|
|
1326
|
+
"type": "u64";
|
|
1327
1327
|
},
|
|
1328
1328
|
{
|
|
1329
|
-
name:
|
|
1330
|
-
docs: [
|
|
1331
|
-
|
|
1329
|
+
"name": "sessionStartTs";
|
|
1330
|
+
"docs": [
|
|
1331
|
+
"Start timestamp of the current session (unix seconds). 0 — not set."
|
|
1332
1332
|
];
|
|
1333
|
-
type:
|
|
1333
|
+
"type": "i64";
|
|
1334
1334
|
},
|
|
1335
1335
|
{
|
|
1336
|
-
name:
|
|
1337
|
-
docs: [
|
|
1338
|
-
|
|
1336
|
+
"name": "sessionFinishTs";
|
|
1337
|
+
"docs": [
|
|
1338
|
+
"Finish timestamp of the current session (unix seconds). 0 — not set."
|
|
1339
1339
|
];
|
|
1340
|
-
type:
|
|
1340
|
+
"type": "i64";
|
|
1341
1341
|
},
|
|
1342
1342
|
{
|
|
1343
|
-
name:
|
|
1344
|
-
docs: [
|
|
1345
|
-
|
|
1343
|
+
"name": "status";
|
|
1344
|
+
"docs": [
|
|
1345
|
+
"Current status of the bond"
|
|
1346
1346
|
];
|
|
1347
|
-
type: {
|
|
1348
|
-
defined: {
|
|
1349
|
-
name:
|
|
1347
|
+
"type": {
|
|
1348
|
+
"defined": {
|
|
1349
|
+
"name": "bondStatus";
|
|
1350
1350
|
};
|
|
1351
1351
|
};
|
|
1352
1352
|
},
|
|
1353
1353
|
{
|
|
1354
|
-
name:
|
|
1355
|
-
docs: [
|
|
1356
|
-
|
|
1354
|
+
"name": "bump";
|
|
1355
|
+
"docs": [
|
|
1356
|
+
"Bump for the PDA"
|
|
1357
1357
|
];
|
|
1358
|
-
type:
|
|
1358
|
+
"type": "u8";
|
|
1359
1359
|
}
|
|
1360
1360
|
];
|
|
1361
1361
|
};
|
|
1362
1362
|
},
|
|
1363
1363
|
{
|
|
1364
|
-
name:
|
|
1365
|
-
type: {
|
|
1366
|
-
kind:
|
|
1367
|
-
variants: [
|
|
1364
|
+
"name": "bondStatus";
|
|
1365
|
+
"type": {
|
|
1366
|
+
"kind": "enum";
|
|
1367
|
+
"variants": [
|
|
1368
1368
|
{
|
|
1369
|
-
name:
|
|
1369
|
+
"name": "active";
|
|
1370
1370
|
},
|
|
1371
1371
|
{
|
|
1372
|
-
name:
|
|
1372
|
+
"name": "disabled";
|
|
1373
1373
|
}
|
|
1374
1374
|
];
|
|
1375
1375
|
};
|
|
1376
1376
|
},
|
|
1377
1377
|
{
|
|
1378
|
-
name:
|
|
1379
|
-
docs: [
|
|
1380
|
-
|
|
1378
|
+
"name": "bondType";
|
|
1379
|
+
"docs": [
|
|
1380
|
+
"Types of bonds supported by the program"
|
|
1381
1381
|
];
|
|
1382
|
-
type: {
|
|
1383
|
-
kind:
|
|
1384
|
-
variants: [
|
|
1382
|
+
"type": {
|
|
1383
|
+
"kind": "enum";
|
|
1384
|
+
"variants": [
|
|
1385
1385
|
{
|
|
1386
|
-
name:
|
|
1386
|
+
"name": "standard";
|
|
1387
1387
|
},
|
|
1388
1388
|
{
|
|
1389
|
-
name:
|
|
1389
|
+
"name": "crowdfunding";
|
|
1390
1390
|
}
|
|
1391
1391
|
];
|
|
1392
1392
|
};
|
|
1393
1393
|
},
|
|
1394
1394
|
{
|
|
1395
|
-
name:
|
|
1396
|
-
type: {
|
|
1397
|
-
kind:
|
|
1398
|
-
fields: [
|
|
1395
|
+
"name": "collateralToppedUp";
|
|
1396
|
+
"type": {
|
|
1397
|
+
"kind": "struct";
|
|
1398
|
+
"fields": [
|
|
1399
1399
|
{
|
|
1400
|
-
name:
|
|
1401
|
-
type:
|
|
1400
|
+
"name": "validator";
|
|
1401
|
+
"type": "pubkey";
|
|
1402
1402
|
},
|
|
1403
1403
|
{
|
|
1404
|
-
name:
|
|
1405
|
-
type:
|
|
1404
|
+
"name": "amount";
|
|
1405
|
+
"type": "u64";
|
|
1406
1406
|
},
|
|
1407
1407
|
{
|
|
1408
|
-
name:
|
|
1409
|
-
type:
|
|
1408
|
+
"name": "postBalance";
|
|
1409
|
+
"type": "u64";
|
|
1410
1410
|
},
|
|
1411
1411
|
{
|
|
1412
|
-
name:
|
|
1413
|
-
type:
|
|
1412
|
+
"name": "timestamp";
|
|
1413
|
+
"type": "i64";
|
|
1414
1414
|
}
|
|
1415
1415
|
];
|
|
1416
1416
|
};
|
|
1417
1417
|
},
|
|
1418
1418
|
{
|
|
1419
|
-
name:
|
|
1420
|
-
docs: [
|
|
1421
|
-
|
|
1419
|
+
"name": "collateralType";
|
|
1420
|
+
"docs": [
|
|
1421
|
+
"Types of collateral that can be used for bond deposit"
|
|
1422
1422
|
];
|
|
1423
|
-
type: {
|
|
1424
|
-
kind:
|
|
1425
|
-
variants: [
|
|
1423
|
+
"type": {
|
|
1424
|
+
"kind": "enum";
|
|
1425
|
+
"variants": [
|
|
1426
1426
|
{
|
|
1427
|
-
name:
|
|
1427
|
+
"name": "native";
|
|
1428
1428
|
},
|
|
1429
1429
|
{
|
|
1430
|
-
name:
|
|
1430
|
+
"name": "stakeAccount";
|
|
1431
1431
|
},
|
|
1432
1432
|
{
|
|
1433
|
-
name:
|
|
1434
|
-
fields: [
|
|
1435
|
-
|
|
1433
|
+
"name": "token";
|
|
1434
|
+
"fields": [
|
|
1435
|
+
"pubkey"
|
|
1436
1436
|
];
|
|
1437
1437
|
}
|
|
1438
1438
|
];
|
|
1439
1439
|
};
|
|
1440
1440
|
},
|
|
1441
1441
|
{
|
|
1442
|
-
name:
|
|
1443
|
-
type: {
|
|
1444
|
-
kind:
|
|
1445
|
-
fields: [
|
|
1442
|
+
"name": "collateralWithdrawn";
|
|
1443
|
+
"type": {
|
|
1444
|
+
"kind": "struct";
|
|
1445
|
+
"fields": [
|
|
1446
1446
|
{
|
|
1447
|
-
name:
|
|
1448
|
-
type:
|
|
1447
|
+
"name": "validator";
|
|
1448
|
+
"type": "pubkey";
|
|
1449
1449
|
},
|
|
1450
1450
|
{
|
|
1451
|
-
name:
|
|
1452
|
-
type:
|
|
1451
|
+
"name": "amount";
|
|
1452
|
+
"type": "u64";
|
|
1453
1453
|
},
|
|
1454
1454
|
{
|
|
1455
|
-
name:
|
|
1456
|
-
type:
|
|
1455
|
+
"name": "postBalance";
|
|
1456
|
+
"type": "u64";
|
|
1457
1457
|
},
|
|
1458
1458
|
{
|
|
1459
|
-
name:
|
|
1460
|
-
type:
|
|
1459
|
+
"name": "timestamp";
|
|
1460
|
+
"type": "i64";
|
|
1461
1461
|
}
|
|
1462
1462
|
];
|
|
1463
1463
|
};
|
|
1464
1464
|
},
|
|
1465
1465
|
{
|
|
1466
|
-
name:
|
|
1467
|
-
type: {
|
|
1468
|
-
kind:
|
|
1469
|
-
fields: [
|
|
1466
|
+
"name": "compensationClaimed";
|
|
1467
|
+
"type": {
|
|
1468
|
+
"kind": "struct";
|
|
1469
|
+
"fields": [
|
|
1470
1470
|
{
|
|
1471
|
-
name:
|
|
1472
|
-
type:
|
|
1471
|
+
"name": "validator";
|
|
1472
|
+
"type": "pubkey";
|
|
1473
1473
|
},
|
|
1474
1474
|
{
|
|
1475
|
-
name:
|
|
1476
|
-
type:
|
|
1475
|
+
"name": "amount";
|
|
1476
|
+
"type": "u64";
|
|
1477
1477
|
},
|
|
1478
1478
|
{
|
|
1479
|
-
name:
|
|
1480
|
-
type:
|
|
1479
|
+
"name": "postBalance";
|
|
1480
|
+
"type": "u64";
|
|
1481
1481
|
},
|
|
1482
1482
|
{
|
|
1483
|
-
name:
|
|
1484
|
-
type:
|
|
1483
|
+
"name": "epoch";
|
|
1484
|
+
"type": "u64";
|
|
1485
1485
|
},
|
|
1486
1486
|
{
|
|
1487
|
-
name:
|
|
1488
|
-
type:
|
|
1487
|
+
"name": "timestamp";
|
|
1488
|
+
"type": "i64";
|
|
1489
1489
|
}
|
|
1490
1490
|
];
|
|
1491
1491
|
};
|
|
1492
1492
|
},
|
|
1493
1493
|
{
|
|
1494
|
-
name:
|
|
1495
|
-
type: {
|
|
1496
|
-
kind:
|
|
1497
|
-
fields: [
|
|
1494
|
+
"name": "globalConfigureData";
|
|
1495
|
+
"type": {
|
|
1496
|
+
"kind": "struct";
|
|
1497
|
+
"fields": [
|
|
1498
1498
|
{
|
|
1499
|
-
name:
|
|
1500
|
-
type: {
|
|
1501
|
-
option:
|
|
1499
|
+
"name": "newAuthority";
|
|
1500
|
+
"type": {
|
|
1501
|
+
"option": "pubkey";
|
|
1502
1502
|
};
|
|
1503
1503
|
}
|
|
1504
1504
|
];
|
|
1505
1505
|
};
|
|
1506
1506
|
},
|
|
1507
1507
|
{
|
|
1508
|
-
name:
|
|
1509
|
-
type: {
|
|
1510
|
-
kind:
|
|
1511
|
-
fields: [
|
|
1508
|
+
"name": "globalState";
|
|
1509
|
+
"type": {
|
|
1510
|
+
"kind": "struct";
|
|
1511
|
+
"fields": [
|
|
1512
1512
|
{
|
|
1513
|
-
name:
|
|
1514
|
-
docs: [
|
|
1515
|
-
|
|
1513
|
+
"name": "authority";
|
|
1514
|
+
"docs": [
|
|
1515
|
+
"The authority allowed to manage the program"
|
|
1516
1516
|
];
|
|
1517
|
-
type:
|
|
1517
|
+
"type": "pubkey";
|
|
1518
1518
|
},
|
|
1519
1519
|
{
|
|
1520
|
-
name:
|
|
1521
|
-
docs: [
|
|
1522
|
-
|
|
1520
|
+
"name": "bump";
|
|
1521
|
+
"docs": [
|
|
1522
|
+
"Bump for the PDA"
|
|
1523
1523
|
];
|
|
1524
|
-
type:
|
|
1524
|
+
"type": "u8";
|
|
1525
1525
|
}
|
|
1526
1526
|
];
|
|
1527
1527
|
};
|
|
1528
1528
|
},
|
|
1529
1529
|
{
|
|
1530
|
-
name:
|
|
1531
|
-
type: {
|
|
1532
|
-
kind:
|
|
1533
|
-
fields: [
|
|
1530
|
+
"name": "validatorBond";
|
|
1531
|
+
"type": {
|
|
1532
|
+
"kind": "struct";
|
|
1533
|
+
"fields": [
|
|
1534
1534
|
{
|
|
1535
|
-
name:
|
|
1536
|
-
|
|
1535
|
+
"name": "state";
|
|
1536
|
+
"docs": [
|
|
1537
|
+
"The bond state address"
|
|
1538
|
+
];
|
|
1539
|
+
"type": "pubkey";
|
|
1537
1540
|
},
|
|
1538
1541
|
{
|
|
1539
|
-
name:
|
|
1540
|
-
|
|
1542
|
+
"name": "identity";
|
|
1543
|
+
"docs": [
|
|
1544
|
+
"Validator identity pubkey"
|
|
1545
|
+
];
|
|
1546
|
+
"type": "pubkey";
|
|
1541
1547
|
},
|
|
1542
1548
|
{
|
|
1543
|
-
name:
|
|
1544
|
-
|
|
1549
|
+
"name": "voteAccount";
|
|
1550
|
+
"docs": [
|
|
1551
|
+
"Validator vote account pubkey"
|
|
1552
|
+
];
|
|
1553
|
+
"type": "pubkey";
|
|
1545
1554
|
},
|
|
1546
1555
|
{
|
|
1547
|
-
name:
|
|
1548
|
-
|
|
1556
|
+
"name": "creator";
|
|
1557
|
+
"docs": [
|
|
1558
|
+
"The bond creator pubkey"
|
|
1559
|
+
];
|
|
1560
|
+
"type": "pubkey";
|
|
1549
1561
|
},
|
|
1550
1562
|
{
|
|
1551
|
-
name:
|
|
1552
|
-
|
|
1553
|
-
|
|
1563
|
+
"name": "withdrawalAuthority";
|
|
1564
|
+
"docs": [
|
|
1565
|
+
"Optional withdrawal authority pubkey (if set, can withdraw on behalf of the validator,",
|
|
1566
|
+
"otherwise only identity can withdraw)"
|
|
1567
|
+
];
|
|
1568
|
+
"type": {
|
|
1569
|
+
"option": "pubkey";
|
|
1554
1570
|
};
|
|
1555
1571
|
},
|
|
1556
1572
|
{
|
|
1557
|
-
name:
|
|
1558
|
-
|
|
1573
|
+
"name": "createdAt";
|
|
1574
|
+
"docs": [
|
|
1575
|
+
"Bond creation timestamp"
|
|
1576
|
+
];
|
|
1577
|
+
"type": "i64";
|
|
1559
1578
|
},
|
|
1560
1579
|
{
|
|
1561
|
-
name:
|
|
1562
|
-
|
|
1580
|
+
"name": "bump";
|
|
1581
|
+
"docs": [
|
|
1582
|
+
"Bump for the PDA"
|
|
1583
|
+
];
|
|
1584
|
+
"type": "u8";
|
|
1563
1585
|
}
|
|
1564
1586
|
];
|
|
1565
1587
|
};
|
|
1566
1588
|
},
|
|
1567
1589
|
{
|
|
1568
|
-
name:
|
|
1569
|
-
type: {
|
|
1570
|
-
kind:
|
|
1571
|
-
fields: [
|
|
1590
|
+
"name": "validatorRegistered";
|
|
1591
|
+
"type": {
|
|
1592
|
+
"kind": "struct";
|
|
1593
|
+
"fields": [
|
|
1572
1594
|
{
|
|
1573
|
-
name:
|
|
1574
|
-
type:
|
|
1595
|
+
"name": "identity";
|
|
1596
|
+
"type": "pubkey";
|
|
1575
1597
|
},
|
|
1576
1598
|
{
|
|
1577
|
-
name:
|
|
1578
|
-
type:
|
|
1599
|
+
"name": "voteAccount";
|
|
1600
|
+
"type": "pubkey";
|
|
1579
1601
|
},
|
|
1580
1602
|
{
|
|
1581
|
-
name:
|
|
1582
|
-
type:
|
|
1603
|
+
"name": "timestamp";
|
|
1604
|
+
"type": "i64";
|
|
1583
1605
|
}
|
|
1584
1606
|
];
|
|
1585
1607
|
};
|
|
1586
1608
|
}
|
|
1587
1609
|
];
|
|
1588
|
-
constants: [
|
|
1610
|
+
"constants": [
|
|
1589
1611
|
{
|
|
1590
|
-
name:
|
|
1591
|
-
docs: [
|
|
1592
|
-
|
|
1612
|
+
"name": "epochLockedSlotTail";
|
|
1613
|
+
"docs": [
|
|
1614
|
+
"Epoch slot index at the end of an epoch after which withdrawals are locked"
|
|
1593
1615
|
];
|
|
1594
|
-
type:
|
|
1595
|
-
value:
|
|
1616
|
+
"type": "u64";
|
|
1617
|
+
"value": "420000";
|
|
1596
1618
|
}
|
|
1597
1619
|
];
|
|
1598
1620
|
};
|
|
@@ -1664,6 +1686,13 @@ type ClaimProps = {
|
|
|
1664
1686
|
reserve?: PublicKey;
|
|
1665
1687
|
authority?: PublicKey;
|
|
1666
1688
|
};
|
|
1689
|
+
type ClaimAllProps = {
|
|
1690
|
+
bondType: BondType;
|
|
1691
|
+
name: string;
|
|
1692
|
+
collateralType?: CollateralType;
|
|
1693
|
+
reserve?: PublicKey;
|
|
1694
|
+
authority?: PublicKey;
|
|
1695
|
+
};
|
|
1667
1696
|
type GetHistoryProps = {
|
|
1668
1697
|
voteAccount: PublicKey;
|
|
1669
1698
|
options?: {
|
|
@@ -1757,7 +1786,7 @@ declare class NodeWallet implements Wallet {
|
|
|
1757
1786
|
/**
|
|
1758
1787
|
* Enum for different client environments.
|
|
1759
1788
|
*/
|
|
1760
|
-
declare enum
|
|
1789
|
+
declare enum JBondClientEnv {
|
|
1761
1790
|
DEV = "dev",
|
|
1762
1791
|
STAGE = "stage",
|
|
1763
1792
|
PROD = "prod"
|
|
@@ -1765,23 +1794,27 @@ declare enum BondClientEnv {
|
|
|
1765
1794
|
/**
|
|
1766
1795
|
* Options for configuring the JBondClient.
|
|
1767
1796
|
*/
|
|
1768
|
-
type
|
|
1797
|
+
type JBondClientOptions = {
|
|
1769
1798
|
debug?: boolean;
|
|
1770
1799
|
} & Record<string, any>;
|
|
1771
1800
|
declare class JBondClient {
|
|
1772
1801
|
readonly provider: Provider;
|
|
1773
|
-
readonly options:
|
|
1802
|
+
readonly options: JBondClientOptions;
|
|
1774
1803
|
readonly program: Program<Jbond>;
|
|
1775
|
-
constructor(provider: Provider, options?:
|
|
1804
|
+
constructor(provider: Provider, options?: JBondClientOptions);
|
|
1776
1805
|
get history(): HistoryManager;
|
|
1806
|
+
/**
|
|
1807
|
+
* Creates a local instance of `JBondClient` for development and testing.
|
|
1808
|
+
*/
|
|
1809
|
+
static local(options?: JBondClientOptions): JBondClient;
|
|
1777
1810
|
/**
|
|
1778
1811
|
* Creates an instance of `JBondClient` using a provided connection and wallet.
|
|
1779
1812
|
*/
|
|
1780
|
-
static fromWallet(connection: Connection, wallet?: Wallet, options?:
|
|
1813
|
+
static fromWallet(connection: Connection, wallet?: Wallet, options?: JBondClientOptions): JBondClient;
|
|
1781
1814
|
/**
|
|
1782
1815
|
* Creates an instance of `JBondClient` using the provided connection and keypair.
|
|
1783
1816
|
*/
|
|
1784
|
-
static fromKeypair(connection: Connection, keypair: Keypair, options?:
|
|
1817
|
+
static fromKeypair(connection: Connection, keypair: Keypair, options?: JBondClientOptions): JBondClient;
|
|
1785
1818
|
/**
|
|
1786
1819
|
* Get the current program ID.
|
|
1787
1820
|
*/
|
|
@@ -1793,11 +1826,11 @@ declare class JBondClient {
|
|
|
1793
1826
|
/**
|
|
1794
1827
|
* Set the environment.
|
|
1795
1828
|
*/
|
|
1796
|
-
env(env:
|
|
1829
|
+
env(env: JBondClientEnv): this;
|
|
1797
1830
|
/**
|
|
1798
1831
|
* Configure a specific option.
|
|
1799
1832
|
*/
|
|
1800
|
-
configure<K extends keyof
|
|
1833
|
+
configure<K extends keyof JBondClientOptions>(key: K, val: JBondClientOptions[K]): this;
|
|
1801
1834
|
/**
|
|
1802
1835
|
* Debug logging
|
|
1803
1836
|
* @param args
|
|
@@ -1832,7 +1865,7 @@ declare class JBondClient {
|
|
|
1832
1865
|
*/
|
|
1833
1866
|
withdrawCollateral(props: WithdrawCollateralProps): Promise<string | undefined>;
|
|
1834
1867
|
/**
|
|
1835
|
-
* Claim compensation
|
|
1868
|
+
* Claim compensation for a validator
|
|
1836
1869
|
*/
|
|
1837
1870
|
claimCompensation(props: ClaimProps): Promise<string | undefined>;
|
|
1838
1871
|
/**
|
|
@@ -1887,6 +1920,10 @@ declare class JBondClient {
|
|
|
1887
1920
|
* Build claim instruction
|
|
1888
1921
|
*/
|
|
1889
1922
|
getClaimIx(props: ClaimProps): Promise<TransactionInstruction>;
|
|
1923
|
+
/**
|
|
1924
|
+
* Build claim all compensations instructions
|
|
1925
|
+
*/
|
|
1926
|
+
getClaimAllCompensationsIxs(props: ClaimAllProps): Promise<TransactionInstruction[]>;
|
|
1890
1927
|
/**
|
|
1891
1928
|
* Build set withdraw authority instruction
|
|
1892
1929
|
*/
|
|
@@ -1952,7 +1989,7 @@ declare class JBondClient {
|
|
|
1952
1989
|
bump: number;
|
|
1953
1990
|
};
|
|
1954
1991
|
stateStats: {
|
|
1955
|
-
totalCollected:
|
|
1992
|
+
totalCollected: number;
|
|
1956
1993
|
status: SessionStatus;
|
|
1957
1994
|
};
|
|
1958
1995
|
}[]>;
|
|
@@ -2032,16 +2069,24 @@ declare class JBondClient {
|
|
|
2032
2069
|
* Get validator bond account balance (in SOL)
|
|
2033
2070
|
*/
|
|
2034
2071
|
getValidatorBondBalance(bondType: BondType, bondName: string, vote: PublicKeyInitData): Promise<number>;
|
|
2072
|
+
getBondStateValidatorBondBalances(bondType: BondType, bondName: string): Promise<{
|
|
2073
|
+
voteAccount: PublicKey;
|
|
2074
|
+
balance: number;
|
|
2075
|
+
}[]>;
|
|
2035
2076
|
/**
|
|
2036
2077
|
* Get total collected collateral for a bond state
|
|
2037
2078
|
*/
|
|
2038
|
-
getBondStateTotalCollected(bondType: BondType, bondName: string
|
|
2079
|
+
getBondStateTotalCollected(bondType: BondType, bondName: string): Promise<number>;
|
|
2039
2080
|
/**
|
|
2040
2081
|
* Get bond state stats
|
|
2041
2082
|
* @param state
|
|
2042
2083
|
* @private
|
|
2043
2084
|
*/
|
|
2044
2085
|
private getBondStateStats;
|
|
2086
|
+
/**
|
|
2087
|
+
* Get validator bond rent exempt amount
|
|
2088
|
+
*/
|
|
2089
|
+
private validatorBondRentExempt;
|
|
2045
2090
|
/**
|
|
2046
2091
|
* Get all validator bonds for a given bond state
|
|
2047
2092
|
*/
|
|
@@ -2062,4 +2107,4 @@ declare const CROWDFUNDING_BOND_SEED = "crowdfunding";
|
|
|
2062
2107
|
*/
|
|
2063
2108
|
declare const ENV_PROGRAM_ID: Record<string, PublicKey>;
|
|
2064
2109
|
|
|
2065
|
-
export { BOND_STATE_SEED,
|
|
2110
|
+
export { BOND_STATE_SEED, type BondConfigureProps, type BondFinishProps, type BondInitializeProps, type BondStartProps, type BondState, type BondStateStats, type BondStateStatus, BondTransactionType, BondType, CROWDFUNDING_BOND_SEED, type ClaimAllProps, type ClaimProps, type CollateralType, ENV_PROGRAM_ID, type EpochHistoryItem, GLOBAL_STATE_SEED, type GetHistoryGroupedProps, type GetHistoryProps, type GlobalConfigureProps, type GlobalInitializeProps, type GlobalState, JBondClient, JBondClientEnv, type JBondClientOptions, type Jbond, NodeWallet, type RegisterValidatorProps, STANDARD_BOND_SEED, SessionStatus, type SetWithdrawAuthorityProps, type TopUpCollateralProps, type TransactionHistoryItem, VALIDATOR_BOND_SEED, type ValidatorBond, type WithdrawCollateralProps };
|