@jpool/bond-sdk 0.9.0-next.17 → 0.9.0-next.19
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 +751 -754
- package/dist/index.d.ts +751 -754
- package/dist/index.js +38 -95
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +38 -96
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Fee } from '@solana/spl-stake-pool/src/layouts';
|
|
2
2
|
import { PublicKey, TransactionInstruction, Connection, PublicKeyInitData, Transaction, VersionedTransaction, Keypair } from '@solana/web3.js';
|
|
3
|
-
import
|
|
3
|
+
import * as bn_js from 'bn.js';
|
|
4
|
+
import bn_js__default from 'bn.js';
|
|
4
5
|
import { IdlTypes, IdlAccounts, Program, Provider } from '@coral-xyz/anchor';
|
|
5
6
|
|
|
6
7
|
type StakePoolManager = {
|
|
7
8
|
stakePoolAddress: PublicKey;
|
|
8
|
-
depositSol: (lamports:
|
|
9
|
-
withdrawSol: (poolTokens:
|
|
9
|
+
depositSol: (lamports: bn_js__default) => TransactionInstruction;
|
|
10
|
+
withdrawSol: (poolTokens: bn_js__default) => TransactionInstruction;
|
|
10
11
|
readonly exchangeRate: number;
|
|
11
12
|
readonly withdrawSolFee: Fee;
|
|
12
13
|
};
|
|
@@ -31,28 +32,28 @@ declare const ENV_PROGRAM_ID: Record<string, PublicKey>;
|
|
|
31
32
|
* IDL can be found at `target/idl/jbond.json`.
|
|
32
33
|
*/
|
|
33
34
|
type Jbond = {
|
|
34
|
-
address:
|
|
35
|
-
metadata: {
|
|
36
|
-
name:
|
|
37
|
-
version:
|
|
38
|
-
spec:
|
|
39
|
-
description:
|
|
35
|
+
"address": "Fo17edWRJewZNTRibgx9iTfjywCW6dzS81VwBLmPFVq1";
|
|
36
|
+
"metadata": {
|
|
37
|
+
"name": "jbond";
|
|
38
|
+
"version": "0.2.1";
|
|
39
|
+
"spec": "0.1.0";
|
|
40
|
+
"description": "Jpool Bond Program";
|
|
40
41
|
};
|
|
41
|
-
instructions: [
|
|
42
|
+
"instructions": [
|
|
42
43
|
{
|
|
43
|
-
name:
|
|
44
|
-
docs: [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
"name": "bondClaim";
|
|
45
|
+
"docs": [
|
|
46
|
+
"Claims compensation for a validator.",
|
|
47
|
+
"Transfers funds from the validator's bond account to reserve.",
|
|
48
|
+
"",
|
|
49
|
+
"# Arguments",
|
|
50
|
+
"* `amount` - Amount of compensation to claim (must be positive).",
|
|
51
|
+
"",
|
|
52
|
+
"# Errors",
|
|
53
|
+
"Fails if the authority is invalid, if the validator is not active,",
|
|
54
|
+
"if the amount is zero, or if there are insufficient funds."
|
|
54
55
|
];
|
|
55
|
-
discriminator: [
|
|
56
|
+
"discriminator": [
|
|
56
57
|
151,
|
|
57
58
|
92,
|
|
58
59
|
10,
|
|
@@ -62,19 +63,19 @@ type Jbond = {
|
|
|
62
63
|
188,
|
|
63
64
|
129
|
|
64
65
|
];
|
|
65
|
-
accounts: [
|
|
66
|
+
"accounts": [
|
|
66
67
|
{
|
|
67
|
-
name:
|
|
68
|
-
writable: true;
|
|
68
|
+
"name": "bondState";
|
|
69
|
+
"writable": true;
|
|
69
70
|
},
|
|
70
71
|
{
|
|
71
|
-
name:
|
|
72
|
-
writable: true;
|
|
73
|
-
pda: {
|
|
74
|
-
seeds: [
|
|
72
|
+
"name": "validatorBond";
|
|
73
|
+
"writable": true;
|
|
74
|
+
"pda": {
|
|
75
|
+
"seeds": [
|
|
75
76
|
{
|
|
76
|
-
kind:
|
|
77
|
-
value: [
|
|
77
|
+
"kind": "const";
|
|
78
|
+
"value": [
|
|
78
79
|
118,
|
|
79
80
|
97,
|
|
80
81
|
108,
|
|
@@ -92,68 +93,68 @@ type Jbond = {
|
|
|
92
93
|
];
|
|
93
94
|
},
|
|
94
95
|
{
|
|
95
|
-
kind:
|
|
96
|
-
path:
|
|
96
|
+
"kind": "account";
|
|
97
|
+
"path": "bondState";
|
|
97
98
|
},
|
|
98
99
|
{
|
|
99
|
-
kind:
|
|
100
|
-
path:
|
|
101
|
-
account:
|
|
100
|
+
"kind": "account";
|
|
101
|
+
"path": "validator_bond.vote_account";
|
|
102
|
+
"account": "validatorBond";
|
|
102
103
|
}
|
|
103
104
|
];
|
|
104
105
|
};
|
|
105
106
|
},
|
|
106
107
|
{
|
|
107
|
-
name:
|
|
108
|
-
writable: true;
|
|
108
|
+
"name": "reserve";
|
|
109
|
+
"writable": true;
|
|
109
110
|
},
|
|
110
111
|
{
|
|
111
|
-
name:
|
|
112
|
-
signer: true;
|
|
112
|
+
"name": "authority";
|
|
113
|
+
"signer": true;
|
|
113
114
|
},
|
|
114
115
|
{
|
|
115
|
-
name:
|
|
116
|
-
writable: true;
|
|
117
|
-
optional: true;
|
|
116
|
+
"name": "bondTokenAccount";
|
|
117
|
+
"writable": true;
|
|
118
|
+
"optional": true;
|
|
118
119
|
},
|
|
119
120
|
{
|
|
120
|
-
name:
|
|
121
|
-
writable: true;
|
|
122
|
-
optional: true;
|
|
121
|
+
"name": "reserveTokenAccount";
|
|
122
|
+
"writable": true;
|
|
123
|
+
"optional": true;
|
|
123
124
|
},
|
|
124
125
|
{
|
|
125
|
-
name:
|
|
126
|
-
writable: true;
|
|
127
|
-
optional: true;
|
|
126
|
+
"name": "stakeAccount";
|
|
127
|
+
"writable": true;
|
|
128
|
+
"optional": true;
|
|
128
129
|
},
|
|
129
130
|
{
|
|
130
|
-
name:
|
|
131
|
-
address:
|
|
131
|
+
"name": "systemProgram";
|
|
132
|
+
"address": "11111111111111111111111111111111";
|
|
132
133
|
},
|
|
133
134
|
{
|
|
134
|
-
name:
|
|
135
|
-
optional: true;
|
|
136
|
-
address:
|
|
135
|
+
"name": "tokenProgram";
|
|
136
|
+
"optional": true;
|
|
137
|
+
"address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
137
138
|
},
|
|
138
139
|
{
|
|
139
|
-
name:
|
|
140
|
-
optional: true;
|
|
140
|
+
"name": "stakeProgram";
|
|
141
|
+
"optional": true;
|
|
141
142
|
}
|
|
142
143
|
];
|
|
143
|
-
args: [
|
|
144
|
+
"args": [
|
|
144
145
|
{
|
|
145
|
-
name:
|
|
146
|
-
type:
|
|
146
|
+
"name": "amount";
|
|
147
|
+
"type": "u64";
|
|
147
148
|
}
|
|
148
149
|
];
|
|
149
150
|
},
|
|
150
151
|
{
|
|
151
|
-
name:
|
|
152
|
-
docs: [
|
|
153
|
-
|
|
154
|
-
|
|
152
|
+
"name": "bondConfigure";
|
|
153
|
+
"docs": [
|
|
154
|
+
"Updates bond configuration, including authority and reserve fields.",
|
|
155
|
+
"Allows changing the bond's authority and updating the reserve account."
|
|
155
156
|
];
|
|
156
|
-
discriminator: [
|
|
157
|
+
"discriminator": [
|
|
157
158
|
61,
|
|
158
159
|
42,
|
|
159
160
|
106,
|
|
@@ -163,103 +164,41 @@ type Jbond = {
|
|
|
163
164
|
65,
|
|
164
165
|
20
|
|
165
166
|
];
|
|
166
|
-
accounts: [
|
|
167
|
+
"accounts": [
|
|
167
168
|
{
|
|
168
|
-
name:
|
|
169
|
-
writable: true;
|
|
169
|
+
"name": "bondState";
|
|
170
|
+
"writable": true;
|
|
170
171
|
},
|
|
171
172
|
{
|
|
172
|
-
name:
|
|
173
|
-
signer: true;
|
|
174
|
-
relations: [
|
|
175
|
-
|
|
173
|
+
"name": "authority";
|
|
174
|
+
"signer": true;
|
|
175
|
+
"relations": [
|
|
176
|
+
"bondState"
|
|
176
177
|
];
|
|
177
178
|
}
|
|
178
179
|
];
|
|
179
|
-
args: [
|
|
180
|
+
"args": [
|
|
180
181
|
{
|
|
181
|
-
name:
|
|
182
|
-
type: {
|
|
183
|
-
defined: {
|
|
184
|
-
name:
|
|
182
|
+
"name": "data";
|
|
183
|
+
"type": {
|
|
184
|
+
"defined": {
|
|
185
|
+
"name": "bondConfigureData";
|
|
185
186
|
};
|
|
186
187
|
};
|
|
187
188
|
}
|
|
188
189
|
];
|
|
189
190
|
},
|
|
190
191
|
{
|
|
191
|
-
name:
|
|
192
|
-
docs: [
|
|
193
|
-
|
|
192
|
+
"name": "bondInitialize";
|
|
193
|
+
"docs": [
|
|
194
|
+
"Initializes state for the bond.",
|
|
195
|
+
"Sets the authority and reserve account for managing validator bonds.",
|
|
196
|
+
"",
|
|
197
|
+
"# Errors",
|
|
198
|
+
"Fails if the global state account is already initialized or if the payer lacks",
|
|
199
|
+
"sufficient funds."
|
|
194
200
|
];
|
|
195
|
-
discriminator: [
|
|
196
|
-
159,
|
|
197
|
-
156,
|
|
198
|
-
97,
|
|
199
|
-
253,
|
|
200
|
-
70,
|
|
201
|
-
122,
|
|
202
|
-
117,
|
|
203
|
-
129
|
|
204
|
-
];
|
|
205
|
-
accounts: [
|
|
206
|
-
{
|
|
207
|
-
name: 'bondState';
|
|
208
|
-
writable: true;
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
name: 'authority';
|
|
212
|
-
writable: true;
|
|
213
|
-
signer: true;
|
|
214
|
-
relations: [
|
|
215
|
-
'bondState'
|
|
216
|
-
];
|
|
217
|
-
}
|
|
218
|
-
];
|
|
219
|
-
args: [];
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
name: 'bondEnable';
|
|
223
|
-
docs: [
|
|
224
|
-
'Enables a previously disabled validator\'s bond.'
|
|
225
|
-
];
|
|
226
|
-
discriminator: [
|
|
227
|
-
133,
|
|
228
|
-
48,
|
|
229
|
-
84,
|
|
230
|
-
9,
|
|
231
|
-
117,
|
|
232
|
-
131,
|
|
233
|
-
164,
|
|
234
|
-
128
|
|
235
|
-
];
|
|
236
|
-
accounts: [
|
|
237
|
-
{
|
|
238
|
-
name: 'bondState';
|
|
239
|
-
writable: true;
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
name: 'authority';
|
|
243
|
-
writable: true;
|
|
244
|
-
signer: true;
|
|
245
|
-
relations: [
|
|
246
|
-
'bondState'
|
|
247
|
-
];
|
|
248
|
-
}
|
|
249
|
-
];
|
|
250
|
-
args: [];
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
name: 'bondInitialize';
|
|
254
|
-
docs: [
|
|
255
|
-
'Initializes state for the bond.',
|
|
256
|
-
'Sets the authority and reserve account for managing validator bonds.',
|
|
257
|
-
'',
|
|
258
|
-
'# Errors',
|
|
259
|
-
'Fails if the global state account is already initialized or if the payer lacks',
|
|
260
|
-
'sufficient funds.'
|
|
261
|
-
];
|
|
262
|
-
discriminator: [
|
|
201
|
+
"discriminator": [
|
|
263
202
|
230,
|
|
264
203
|
3,
|
|
265
204
|
121,
|
|
@@ -269,18 +208,18 @@ type Jbond = {
|
|
|
269
208
|
175,
|
|
270
209
|
210
|
|
271
210
|
];
|
|
272
|
-
accounts: [
|
|
211
|
+
"accounts": [
|
|
273
212
|
{
|
|
274
|
-
name:
|
|
213
|
+
"name": "globalState";
|
|
275
214
|
},
|
|
276
215
|
{
|
|
277
|
-
name:
|
|
278
|
-
writable: true;
|
|
279
|
-
pda: {
|
|
280
|
-
seeds: [
|
|
216
|
+
"name": "bondState";
|
|
217
|
+
"writable": true;
|
|
218
|
+
"pda": {
|
|
219
|
+
"seeds": [
|
|
281
220
|
{
|
|
282
|
-
kind:
|
|
283
|
-
value: [
|
|
221
|
+
"kind": "const";
|
|
222
|
+
"value": [
|
|
284
223
|
98,
|
|
285
224
|
111,
|
|
286
225
|
110,
|
|
@@ -294,75 +233,75 @@ type Jbond = {
|
|
|
294
233
|
];
|
|
295
234
|
},
|
|
296
235
|
{
|
|
297
|
-
kind:
|
|
298
|
-
path:
|
|
236
|
+
"kind": "arg";
|
|
237
|
+
"path": "data.bond_type";
|
|
299
238
|
},
|
|
300
239
|
{
|
|
301
|
-
kind:
|
|
302
|
-
path:
|
|
240
|
+
"kind": "arg";
|
|
241
|
+
"path": "data.name";
|
|
303
242
|
}
|
|
304
243
|
];
|
|
305
244
|
};
|
|
306
245
|
},
|
|
307
246
|
{
|
|
308
|
-
name:
|
|
309
|
-
writable: true;
|
|
310
|
-
signer: true;
|
|
311
|
-
relations: [
|
|
312
|
-
|
|
247
|
+
"name": "authority";
|
|
248
|
+
"writable": true;
|
|
249
|
+
"signer": true;
|
|
250
|
+
"relations": [
|
|
251
|
+
"globalState"
|
|
313
252
|
];
|
|
314
253
|
},
|
|
315
254
|
{
|
|
316
|
-
name:
|
|
255
|
+
"name": "reserve";
|
|
317
256
|
},
|
|
318
257
|
{
|
|
319
|
-
name:
|
|
320
|
-
address:
|
|
258
|
+
"name": "associatedTokenProgram";
|
|
259
|
+
"address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
321
260
|
},
|
|
322
261
|
{
|
|
323
|
-
name:
|
|
324
|
-
address:
|
|
262
|
+
"name": "systemProgram";
|
|
263
|
+
"address": "11111111111111111111111111111111";
|
|
325
264
|
},
|
|
326
265
|
{
|
|
327
|
-
name:
|
|
328
|
-
address:
|
|
266
|
+
"name": "tokenProgram";
|
|
267
|
+
"address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
329
268
|
},
|
|
330
269
|
{
|
|
331
|
-
name:
|
|
332
|
-
writable: true;
|
|
333
|
-
optional: true;
|
|
270
|
+
"name": "reserveTokenAccount";
|
|
271
|
+
"writable": true;
|
|
272
|
+
"optional": true;
|
|
334
273
|
},
|
|
335
274
|
{
|
|
336
|
-
name:
|
|
337
|
-
optional: true;
|
|
275
|
+
"name": "mint";
|
|
276
|
+
"optional": true;
|
|
338
277
|
}
|
|
339
278
|
];
|
|
340
|
-
args: [
|
|
279
|
+
"args": [
|
|
341
280
|
{
|
|
342
|
-
name:
|
|
343
|
-
type: {
|
|
344
|
-
defined: {
|
|
345
|
-
name:
|
|
281
|
+
"name": "data";
|
|
282
|
+
"type": {
|
|
283
|
+
"defined": {
|
|
284
|
+
"name": "bondInitializeData";
|
|
346
285
|
};
|
|
347
286
|
};
|
|
348
287
|
}
|
|
349
288
|
];
|
|
350
289
|
},
|
|
351
290
|
{
|
|
352
|
-
name:
|
|
353
|
-
docs: [
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
291
|
+
"name": "bondRegister";
|
|
292
|
+
"docs": [
|
|
293
|
+
"Registers a new validator with the bond.",
|
|
294
|
+
"Sets up the validator's bond account and deposits initial collateral.",
|
|
295
|
+
"",
|
|
296
|
+
"# Arguments",
|
|
297
|
+
"* `initial_collateral` - Amount of collateral to lock (must be positive).",
|
|
298
|
+
"* `withdrawal_authority` - Optional key that can withdraw collateral later.",
|
|
299
|
+
"",
|
|
300
|
+
"# Errors",
|
|
301
|
+
"Fails if the validator is already registered, if the vote account is invalid,",
|
|
302
|
+
"or if the initial collateral transfer fails."
|
|
364
303
|
];
|
|
365
|
-
discriminator: [
|
|
304
|
+
"discriminator": [
|
|
366
305
|
117,
|
|
367
306
|
127,
|
|
368
307
|
78,
|
|
@@ -372,19 +311,19 @@ type Jbond = {
|
|
|
372
311
|
163,
|
|
373
312
|
83
|
|
374
313
|
];
|
|
375
|
-
accounts: [
|
|
314
|
+
"accounts": [
|
|
376
315
|
{
|
|
377
|
-
name:
|
|
378
|
-
writable: true;
|
|
316
|
+
"name": "bondState";
|
|
317
|
+
"writable": true;
|
|
379
318
|
},
|
|
380
319
|
{
|
|
381
|
-
name:
|
|
382
|
-
writable: true;
|
|
383
|
-
pda: {
|
|
384
|
-
seeds: [
|
|
320
|
+
"name": "validatorBond";
|
|
321
|
+
"writable": true;
|
|
322
|
+
"pda": {
|
|
323
|
+
"seeds": [
|
|
385
324
|
{
|
|
386
|
-
kind:
|
|
387
|
-
value: [
|
|
325
|
+
"kind": "const";
|
|
326
|
+
"value": [
|
|
388
327
|
118,
|
|
389
328
|
97,
|
|
390
329
|
108,
|
|
@@ -402,78 +341,78 @@ type Jbond = {
|
|
|
402
341
|
];
|
|
403
342
|
},
|
|
404
343
|
{
|
|
405
|
-
kind:
|
|
406
|
-
path:
|
|
344
|
+
"kind": "account";
|
|
345
|
+
"path": "bondState";
|
|
407
346
|
},
|
|
408
347
|
{
|
|
409
|
-
kind:
|
|
410
|
-
path:
|
|
348
|
+
"kind": "account";
|
|
349
|
+
"path": "voteAccount";
|
|
411
350
|
}
|
|
412
351
|
];
|
|
413
352
|
};
|
|
414
353
|
},
|
|
415
354
|
{
|
|
416
|
-
name:
|
|
355
|
+
"name": "identity";
|
|
417
356
|
},
|
|
418
357
|
{
|
|
419
|
-
name:
|
|
358
|
+
"name": "voteAccount";
|
|
420
359
|
},
|
|
421
360
|
{
|
|
422
|
-
name:
|
|
423
|
-
writable: true;
|
|
424
|
-
signer: true;
|
|
361
|
+
"name": "creator";
|
|
362
|
+
"writable": true;
|
|
363
|
+
"signer": true;
|
|
425
364
|
},
|
|
426
365
|
{
|
|
427
|
-
name:
|
|
428
|
-
address:
|
|
366
|
+
"name": "systemProgram";
|
|
367
|
+
"address": "11111111111111111111111111111111";
|
|
429
368
|
},
|
|
430
369
|
{
|
|
431
|
-
name:
|
|
432
|
-
address:
|
|
370
|
+
"name": "tokenProgram";
|
|
371
|
+
"address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
433
372
|
},
|
|
434
373
|
{
|
|
435
|
-
name:
|
|
436
|
-
address:
|
|
374
|
+
"name": "associatedTokenProgram";
|
|
375
|
+
"address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
437
376
|
},
|
|
438
377
|
{
|
|
439
|
-
name:
|
|
440
|
-
writable: true;
|
|
441
|
-
optional: true;
|
|
378
|
+
"name": "bondTokenAccount";
|
|
379
|
+
"writable": true;
|
|
380
|
+
"optional": true;
|
|
442
381
|
},
|
|
443
382
|
{
|
|
444
|
-
name:
|
|
445
|
-
optional: true;
|
|
383
|
+
"name": "mint";
|
|
384
|
+
"optional": true;
|
|
446
385
|
}
|
|
447
386
|
];
|
|
448
|
-
args: [
|
|
387
|
+
"args": [
|
|
449
388
|
{
|
|
450
|
-
name:
|
|
451
|
-
type: {
|
|
452
|
-
defined: {
|
|
453
|
-
name:
|
|
389
|
+
"name": "bondType";
|
|
390
|
+
"type": {
|
|
391
|
+
"defined": {
|
|
392
|
+
"name": "bondType";
|
|
454
393
|
};
|
|
455
394
|
};
|
|
456
395
|
},
|
|
457
396
|
{
|
|
458
|
-
name:
|
|
459
|
-
type:
|
|
397
|
+
"name": "bondName";
|
|
398
|
+
"type": "string";
|
|
460
399
|
}
|
|
461
400
|
];
|
|
462
401
|
},
|
|
463
402
|
{
|
|
464
|
-
name:
|
|
465
|
-
docs: [
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
403
|
+
"name": "bondSetWithdrawAuthority";
|
|
404
|
+
"docs": [
|
|
405
|
+
"Sets a new withdrawal authority for a validator's bond account.",
|
|
406
|
+
"Allows changing who can withdraw collateral in the future.",
|
|
407
|
+
"",
|
|
408
|
+
"# Arguments",
|
|
409
|
+
"* `new_withdraw_authority` - Optional new withdrawal authority key (None to restrict to",
|
|
410
|
+
"identity).",
|
|
411
|
+
"",
|
|
412
|
+
"# Errors",
|
|
413
|
+
"Fails if the signer is not authorized to change the withdrawal authority."
|
|
475
414
|
];
|
|
476
|
-
discriminator: [
|
|
415
|
+
"discriminator": [
|
|
477
416
|
212,
|
|
478
417
|
162,
|
|
479
418
|
53,
|
|
@@ -483,18 +422,18 @@ type Jbond = {
|
|
|
483
422
|
61,
|
|
484
423
|
166
|
|
485
424
|
];
|
|
486
|
-
accounts: [
|
|
425
|
+
"accounts": [
|
|
487
426
|
{
|
|
488
|
-
name:
|
|
427
|
+
"name": "bondState";
|
|
489
428
|
},
|
|
490
429
|
{
|
|
491
|
-
name:
|
|
492
|
-
writable: true;
|
|
493
|
-
pda: {
|
|
494
|
-
seeds: [
|
|
430
|
+
"name": "validatorBond";
|
|
431
|
+
"writable": true;
|
|
432
|
+
"pda": {
|
|
433
|
+
"seeds": [
|
|
495
434
|
{
|
|
496
|
-
kind:
|
|
497
|
-
value: [
|
|
435
|
+
"kind": "const";
|
|
436
|
+
"value": [
|
|
498
437
|
118,
|
|
499
438
|
97,
|
|
500
439
|
108,
|
|
@@ -512,42 +451,42 @@ type Jbond = {
|
|
|
512
451
|
];
|
|
513
452
|
},
|
|
514
453
|
{
|
|
515
|
-
kind:
|
|
516
|
-
path:
|
|
454
|
+
"kind": "account";
|
|
455
|
+
"path": "bondState";
|
|
517
456
|
},
|
|
518
457
|
{
|
|
519
|
-
kind:
|
|
520
|
-
path:
|
|
521
|
-
account:
|
|
458
|
+
"kind": "account";
|
|
459
|
+
"path": "validator_bond.vote_account";
|
|
460
|
+
"account": "validatorBond";
|
|
522
461
|
}
|
|
523
462
|
];
|
|
524
463
|
};
|
|
525
464
|
},
|
|
526
465
|
{
|
|
527
|
-
name:
|
|
528
|
-
signer: true;
|
|
466
|
+
"name": "identity";
|
|
467
|
+
"signer": true;
|
|
529
468
|
},
|
|
530
469
|
{
|
|
531
|
-
name:
|
|
532
|
-
optional: true;
|
|
470
|
+
"name": "newWithdrawAuthority";
|
|
471
|
+
"optional": true;
|
|
533
472
|
}
|
|
534
473
|
];
|
|
535
|
-
args: [];
|
|
474
|
+
"args": [];
|
|
536
475
|
},
|
|
537
476
|
{
|
|
538
|
-
name:
|
|
539
|
-
docs: [
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
477
|
+
"name": "bondTopUp";
|
|
478
|
+
"docs": [
|
|
479
|
+
"Adds additional collateral to an existing validator's bond.",
|
|
480
|
+
"Increases the collateral balance, enhancing the validator's stake.",
|
|
481
|
+
"",
|
|
482
|
+
"# Arguments",
|
|
483
|
+
"* `amount` - Amount to add.",
|
|
484
|
+
"",
|
|
485
|
+
"# Errors",
|
|
486
|
+
"Fails if the validator is not active, if the amount is zero,",
|
|
487
|
+
"or if the transfer of funds fails."
|
|
549
488
|
];
|
|
550
|
-
discriminator: [
|
|
489
|
+
"discriminator": [
|
|
551
490
|
132,
|
|
552
491
|
225,
|
|
553
492
|
254,
|
|
@@ -557,19 +496,19 @@ type Jbond = {
|
|
|
557
496
|
176,
|
|
558
497
|
66
|
|
559
498
|
];
|
|
560
|
-
accounts: [
|
|
499
|
+
"accounts": [
|
|
561
500
|
{
|
|
562
|
-
name:
|
|
563
|
-
writable: true;
|
|
501
|
+
"name": "bondState";
|
|
502
|
+
"writable": true;
|
|
564
503
|
},
|
|
565
504
|
{
|
|
566
|
-
name:
|
|
567
|
-
writable: true;
|
|
568
|
-
pda: {
|
|
569
|
-
seeds: [
|
|
505
|
+
"name": "validatorBond";
|
|
506
|
+
"writable": true;
|
|
507
|
+
"pda": {
|
|
508
|
+
"seeds": [
|
|
570
509
|
{
|
|
571
|
-
kind:
|
|
572
|
-
value: [
|
|
510
|
+
"kind": "const";
|
|
511
|
+
"value": [
|
|
573
512
|
118,
|
|
574
513
|
97,
|
|
575
514
|
108,
|
|
@@ -587,73 +526,73 @@ type Jbond = {
|
|
|
587
526
|
];
|
|
588
527
|
},
|
|
589
528
|
{
|
|
590
|
-
kind:
|
|
591
|
-
path:
|
|
529
|
+
"kind": "account";
|
|
530
|
+
"path": "bondState";
|
|
592
531
|
},
|
|
593
532
|
{
|
|
594
|
-
kind:
|
|
595
|
-
path:
|
|
596
|
-
account:
|
|
533
|
+
"kind": "account";
|
|
534
|
+
"path": "validator_bond.vote_account";
|
|
535
|
+
"account": "validatorBond";
|
|
597
536
|
}
|
|
598
537
|
];
|
|
599
538
|
};
|
|
600
539
|
},
|
|
601
540
|
{
|
|
602
|
-
name:
|
|
603
|
-
writable: true;
|
|
604
|
-
signer: true;
|
|
541
|
+
"name": "payer";
|
|
542
|
+
"writable": true;
|
|
543
|
+
"signer": true;
|
|
605
544
|
},
|
|
606
545
|
{
|
|
607
|
-
name:
|
|
608
|
-
writable: true;
|
|
609
|
-
optional: true;
|
|
546
|
+
"name": "payerTokenAccount";
|
|
547
|
+
"writable": true;
|
|
548
|
+
"optional": true;
|
|
610
549
|
},
|
|
611
550
|
{
|
|
612
|
-
name:
|
|
613
|
-
writable: true;
|
|
614
|
-
optional: true;
|
|
551
|
+
"name": "bondTokenAccount";
|
|
552
|
+
"writable": true;
|
|
553
|
+
"optional": true;
|
|
615
554
|
},
|
|
616
555
|
{
|
|
617
|
-
name:
|
|
618
|
-
writable: true;
|
|
619
|
-
optional: true;
|
|
556
|
+
"name": "stakeAccount";
|
|
557
|
+
"writable": true;
|
|
558
|
+
"optional": true;
|
|
620
559
|
},
|
|
621
560
|
{
|
|
622
|
-
name:
|
|
623
|
-
address:
|
|
561
|
+
"name": "systemProgram";
|
|
562
|
+
"address": "11111111111111111111111111111111";
|
|
624
563
|
},
|
|
625
564
|
{
|
|
626
|
-
name:
|
|
627
|
-
optional: true;
|
|
628
|
-
address:
|
|
565
|
+
"name": "tokenProgram";
|
|
566
|
+
"optional": true;
|
|
567
|
+
"address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
629
568
|
},
|
|
630
569
|
{
|
|
631
|
-
name:
|
|
632
|
-
optional: true;
|
|
570
|
+
"name": "stakeProgram";
|
|
571
|
+
"optional": true;
|
|
633
572
|
}
|
|
634
573
|
];
|
|
635
|
-
args: [
|
|
574
|
+
"args": [
|
|
636
575
|
{
|
|
637
|
-
name:
|
|
638
|
-
type:
|
|
576
|
+
"name": "amount";
|
|
577
|
+
"type": "u64";
|
|
639
578
|
}
|
|
640
579
|
];
|
|
641
580
|
},
|
|
642
581
|
{
|
|
643
|
-
name:
|
|
644
|
-
docs: [
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
582
|
+
"name": "bondWithdraw";
|
|
583
|
+
"docs": [
|
|
584
|
+
"Withdraws collateral from a validator's bond.",
|
|
585
|
+
"Decreases the collateral balance, allowing the validator to reclaim funds.",
|
|
586
|
+
"",
|
|
587
|
+
"# Arguments",
|
|
588
|
+
"* `amount` - Amount to withdraw (must not exceed available balance).",
|
|
589
|
+
"",
|
|
590
|
+
"# Errors",
|
|
591
|
+
"Fails if the validator is not active, if the amount is zero,",
|
|
592
|
+
"if the withdrawal authority is invalid, or if the withdrawal would",
|
|
593
|
+
"leave insufficient collateral."
|
|
655
594
|
];
|
|
656
|
-
discriminator: [
|
|
595
|
+
"discriminator": [
|
|
657
596
|
99,
|
|
658
597
|
64,
|
|
659
598
|
127,
|
|
@@ -663,19 +602,19 @@ type Jbond = {
|
|
|
663
602
|
70,
|
|
664
603
|
204
|
|
665
604
|
];
|
|
666
|
-
accounts: [
|
|
605
|
+
"accounts": [
|
|
667
606
|
{
|
|
668
|
-
name:
|
|
669
|
-
writable: true;
|
|
607
|
+
"name": "bondState";
|
|
608
|
+
"writable": true;
|
|
670
609
|
},
|
|
671
610
|
{
|
|
672
|
-
name:
|
|
673
|
-
writable: true;
|
|
674
|
-
pda: {
|
|
675
|
-
seeds: [
|
|
611
|
+
"name": "validatorBond";
|
|
612
|
+
"writable": true;
|
|
613
|
+
"pda": {
|
|
614
|
+
"seeds": [
|
|
676
615
|
{
|
|
677
|
-
kind:
|
|
678
|
-
value: [
|
|
616
|
+
"kind": "const";
|
|
617
|
+
"value": [
|
|
679
618
|
118,
|
|
680
619
|
97,
|
|
681
620
|
108,
|
|
@@ -693,65 +632,65 @@ type Jbond = {
|
|
|
693
632
|
];
|
|
694
633
|
},
|
|
695
634
|
{
|
|
696
|
-
kind:
|
|
697
|
-
path:
|
|
635
|
+
"kind": "account";
|
|
636
|
+
"path": "bondState";
|
|
698
637
|
},
|
|
699
638
|
{
|
|
700
|
-
kind:
|
|
701
|
-
path:
|
|
702
|
-
account:
|
|
639
|
+
"kind": "account";
|
|
640
|
+
"path": "validator_bond.vote_account";
|
|
641
|
+
"account": "validatorBond";
|
|
703
642
|
}
|
|
704
643
|
];
|
|
705
644
|
};
|
|
706
645
|
},
|
|
707
646
|
{
|
|
708
|
-
name:
|
|
709
|
-
writable: true;
|
|
710
|
-
signer: true;
|
|
647
|
+
"name": "withdrawalAuthority";
|
|
648
|
+
"writable": true;
|
|
649
|
+
"signer": true;
|
|
711
650
|
},
|
|
712
651
|
{
|
|
713
|
-
name:
|
|
714
|
-
writable: true;
|
|
652
|
+
"name": "destination";
|
|
653
|
+
"writable": true;
|
|
715
654
|
},
|
|
716
655
|
{
|
|
717
|
-
name:
|
|
718
|
-
writable: true;
|
|
719
|
-
optional: true;
|
|
656
|
+
"name": "destinationTokenAccount";
|
|
657
|
+
"writable": true;
|
|
658
|
+
"optional": true;
|
|
720
659
|
},
|
|
721
660
|
{
|
|
722
|
-
name:
|
|
723
|
-
writable: true;
|
|
724
|
-
optional: true;
|
|
661
|
+
"name": "bondTokenAccount";
|
|
662
|
+
"writable": true;
|
|
663
|
+
"optional": true;
|
|
725
664
|
},
|
|
726
665
|
{
|
|
727
|
-
name:
|
|
728
|
-
writable: true;
|
|
729
|
-
optional: true;
|
|
666
|
+
"name": "stakeAccount";
|
|
667
|
+
"writable": true;
|
|
668
|
+
"optional": true;
|
|
730
669
|
},
|
|
731
670
|
{
|
|
732
|
-
name:
|
|
733
|
-
address:
|
|
671
|
+
"name": "systemProgram";
|
|
672
|
+
"address": "11111111111111111111111111111111";
|
|
734
673
|
},
|
|
735
674
|
{
|
|
736
|
-
name:
|
|
737
|
-
optional: true;
|
|
738
|
-
address:
|
|
675
|
+
"name": "tokenProgram";
|
|
676
|
+
"optional": true;
|
|
677
|
+
"address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
739
678
|
},
|
|
740
679
|
{
|
|
741
|
-
name:
|
|
742
|
-
optional: true;
|
|
680
|
+
"name": "stakeProgram";
|
|
681
|
+
"optional": true;
|
|
743
682
|
}
|
|
744
683
|
];
|
|
745
|
-
args: [
|
|
684
|
+
"args": [
|
|
746
685
|
{
|
|
747
|
-
name:
|
|
748
|
-
type:
|
|
686
|
+
"name": "amount";
|
|
687
|
+
"type": "u64";
|
|
749
688
|
}
|
|
750
689
|
];
|
|
751
690
|
},
|
|
752
691
|
{
|
|
753
|
-
name:
|
|
754
|
-
discriminator: [
|
|
692
|
+
"name": "globalConfigure";
|
|
693
|
+
"discriminator": [
|
|
755
694
|
67,
|
|
756
695
|
142,
|
|
757
696
|
164,
|
|
@@ -761,15 +700,15 @@ type Jbond = {
|
|
|
761
700
|
144,
|
|
762
701
|
187
|
|
763
702
|
];
|
|
764
|
-
accounts: [
|
|
703
|
+
"accounts": [
|
|
765
704
|
{
|
|
766
|
-
name:
|
|
767
|
-
writable: true;
|
|
768
|
-
pda: {
|
|
769
|
-
seeds: [
|
|
705
|
+
"name": "globalState";
|
|
706
|
+
"writable": true;
|
|
707
|
+
"pda": {
|
|
708
|
+
"seeds": [
|
|
770
709
|
{
|
|
771
|
-
kind:
|
|
772
|
-
value: [
|
|
710
|
+
"kind": "const";
|
|
711
|
+
"value": [
|
|
773
712
|
103,
|
|
774
713
|
108,
|
|
775
714
|
111,
|
|
@@ -788,30 +727,30 @@ type Jbond = {
|
|
|
788
727
|
};
|
|
789
728
|
},
|
|
790
729
|
{
|
|
791
|
-
name:
|
|
792
|
-
signer: true;
|
|
793
|
-
relations: [
|
|
794
|
-
|
|
730
|
+
"name": "authority";
|
|
731
|
+
"signer": true;
|
|
732
|
+
"relations": [
|
|
733
|
+
"globalState"
|
|
795
734
|
];
|
|
796
735
|
}
|
|
797
736
|
];
|
|
798
|
-
args: [
|
|
737
|
+
"args": [
|
|
799
738
|
{
|
|
800
|
-
name:
|
|
801
|
-
type: {
|
|
802
|
-
defined: {
|
|
803
|
-
name:
|
|
739
|
+
"name": "data";
|
|
740
|
+
"type": {
|
|
741
|
+
"defined": {
|
|
742
|
+
"name": "globalConfigureData";
|
|
804
743
|
};
|
|
805
744
|
};
|
|
806
745
|
}
|
|
807
746
|
];
|
|
808
747
|
},
|
|
809
748
|
{
|
|
810
|
-
name:
|
|
811
|
-
docs: [
|
|
812
|
-
|
|
749
|
+
"name": "globalInitialize";
|
|
750
|
+
"docs": [
|
|
751
|
+
"----------------------------- Global Instructions ----------------------------"
|
|
813
752
|
];
|
|
814
|
-
discriminator: [
|
|
753
|
+
"discriminator": [
|
|
815
754
|
30,
|
|
816
755
|
79,
|
|
817
756
|
193,
|
|
@@ -821,15 +760,15 @@ type Jbond = {
|
|
|
821
760
|
223,
|
|
822
761
|
196
|
|
823
762
|
];
|
|
824
|
-
accounts: [
|
|
763
|
+
"accounts": [
|
|
825
764
|
{
|
|
826
|
-
name:
|
|
827
|
-
writable: true;
|
|
828
|
-
pda: {
|
|
829
|
-
seeds: [
|
|
765
|
+
"name": "globalState";
|
|
766
|
+
"writable": true;
|
|
767
|
+
"pda": {
|
|
768
|
+
"seeds": [
|
|
830
769
|
{
|
|
831
|
-
kind:
|
|
832
|
-
value: [
|
|
770
|
+
"kind": "const";
|
|
771
|
+
"value": [
|
|
833
772
|
103,
|
|
834
773
|
108,
|
|
835
774
|
111,
|
|
@@ -848,23 +787,23 @@ type Jbond = {
|
|
|
848
787
|
};
|
|
849
788
|
},
|
|
850
789
|
{
|
|
851
|
-
name:
|
|
852
|
-
writable: true;
|
|
853
|
-
signer: true;
|
|
790
|
+
"name": "authority";
|
|
791
|
+
"writable": true;
|
|
792
|
+
"signer": true;
|
|
854
793
|
},
|
|
855
794
|
{
|
|
856
|
-
name:
|
|
857
|
-
address:
|
|
795
|
+
"name": "systemProgram";
|
|
796
|
+
"address": "11111111111111111111111111111111";
|
|
858
797
|
}
|
|
859
798
|
];
|
|
860
|
-
args: [];
|
|
799
|
+
"args": [];
|
|
861
800
|
},
|
|
862
801
|
{
|
|
863
|
-
name:
|
|
864
|
-
docs: [
|
|
865
|
-
|
|
802
|
+
"name": "sessionFinish";
|
|
803
|
+
"docs": [
|
|
804
|
+
"Finishes a bond, preventing further deposits and withdrawals."
|
|
866
805
|
];
|
|
867
|
-
discriminator: [
|
|
806
|
+
"discriminator": [
|
|
868
807
|
230,
|
|
869
808
|
209,
|
|
870
809
|
54,
|
|
@@ -874,28 +813,28 @@ type Jbond = {
|
|
|
874
813
|
137,
|
|
875
814
|
113
|
|
876
815
|
];
|
|
877
|
-
accounts: [
|
|
816
|
+
"accounts": [
|
|
878
817
|
{
|
|
879
|
-
name:
|
|
880
|
-
writable: true;
|
|
818
|
+
"name": "bondState";
|
|
819
|
+
"writable": true;
|
|
881
820
|
},
|
|
882
821
|
{
|
|
883
|
-
name:
|
|
884
|
-
writable: true;
|
|
885
|
-
signer: true;
|
|
886
|
-
relations: [
|
|
887
|
-
|
|
822
|
+
"name": "authority";
|
|
823
|
+
"writable": true;
|
|
824
|
+
"signer": true;
|
|
825
|
+
"relations": [
|
|
826
|
+
"bondState"
|
|
888
827
|
];
|
|
889
828
|
}
|
|
890
829
|
];
|
|
891
|
-
args: [];
|
|
830
|
+
"args": [];
|
|
892
831
|
},
|
|
893
832
|
{
|
|
894
|
-
name:
|
|
895
|
-
docs: [
|
|
896
|
-
|
|
833
|
+
"name": "sessionStart";
|
|
834
|
+
"docs": [
|
|
835
|
+
"Starts a paused bond, allowing deposits and withdrawals to resume."
|
|
897
836
|
];
|
|
898
|
-
discriminator: [
|
|
837
|
+
"discriminator": [
|
|
899
838
|
132,
|
|
900
839
|
93,
|
|
901
840
|
83,
|
|
@@ -905,32 +844,32 @@ type Jbond = {
|
|
|
905
844
|
58,
|
|
906
845
|
92
|
|
907
846
|
];
|
|
908
|
-
accounts: [
|
|
847
|
+
"accounts": [
|
|
909
848
|
{
|
|
910
|
-
name:
|
|
911
|
-
writable: true;
|
|
849
|
+
"name": "bondState";
|
|
850
|
+
"writable": true;
|
|
912
851
|
},
|
|
913
852
|
{
|
|
914
|
-
name:
|
|
915
|
-
writable: true;
|
|
916
|
-
signer: true;
|
|
917
|
-
relations: [
|
|
918
|
-
|
|
853
|
+
"name": "authority";
|
|
854
|
+
"writable": true;
|
|
855
|
+
"signer": true;
|
|
856
|
+
"relations": [
|
|
857
|
+
"bondState"
|
|
919
858
|
];
|
|
920
859
|
}
|
|
921
860
|
];
|
|
922
|
-
args: [
|
|
861
|
+
"args": [
|
|
923
862
|
{
|
|
924
|
-
name:
|
|
925
|
-
type:
|
|
863
|
+
"name": "durationSecs";
|
|
864
|
+
"type": "u64";
|
|
926
865
|
}
|
|
927
866
|
];
|
|
928
867
|
}
|
|
929
868
|
];
|
|
930
|
-
accounts: [
|
|
869
|
+
"accounts": [
|
|
931
870
|
{
|
|
932
|
-
name:
|
|
933
|
-
discriminator: [
|
|
871
|
+
"name": "bondState";
|
|
872
|
+
"discriminator": [
|
|
934
873
|
251,
|
|
935
874
|
95,
|
|
936
875
|
76,
|
|
@@ -942,8 +881,8 @@ type Jbond = {
|
|
|
942
881
|
];
|
|
943
882
|
},
|
|
944
883
|
{
|
|
945
|
-
name:
|
|
946
|
-
discriminator: [
|
|
884
|
+
"name": "globalState";
|
|
885
|
+
"discriminator": [
|
|
947
886
|
163,
|
|
948
887
|
46,
|
|
949
888
|
74,
|
|
@@ -955,8 +894,8 @@ type Jbond = {
|
|
|
955
894
|
];
|
|
956
895
|
},
|
|
957
896
|
{
|
|
958
|
-
name:
|
|
959
|
-
discriminator: [
|
|
897
|
+
"name": "validatorBond";
|
|
898
|
+
"discriminator": [
|
|
960
899
|
82,
|
|
961
900
|
127,
|
|
962
901
|
243,
|
|
@@ -968,10 +907,10 @@ type Jbond = {
|
|
|
968
907
|
];
|
|
969
908
|
}
|
|
970
909
|
];
|
|
971
|
-
events: [
|
|
910
|
+
"events": [
|
|
972
911
|
{
|
|
973
|
-
name:
|
|
974
|
-
discriminator: [
|
|
912
|
+
"name": "bondFinished";
|
|
913
|
+
"discriminator": [
|
|
975
914
|
223,
|
|
976
915
|
254,
|
|
977
916
|
3,
|
|
@@ -983,8 +922,8 @@ type Jbond = {
|
|
|
983
922
|
];
|
|
984
923
|
},
|
|
985
924
|
{
|
|
986
|
-
name:
|
|
987
|
-
discriminator: [
|
|
925
|
+
"name": "bondStarted";
|
|
926
|
+
"discriminator": [
|
|
988
927
|
235,
|
|
989
928
|
69,
|
|
990
929
|
80,
|
|
@@ -996,8 +935,8 @@ type Jbond = {
|
|
|
996
935
|
];
|
|
997
936
|
},
|
|
998
937
|
{
|
|
999
|
-
name:
|
|
1000
|
-
discriminator: [
|
|
938
|
+
"name": "collateralToppedUp";
|
|
939
|
+
"discriminator": [
|
|
1001
940
|
189,
|
|
1002
941
|
137,
|
|
1003
942
|
204,
|
|
@@ -1009,8 +948,8 @@ type Jbond = {
|
|
|
1009
948
|
];
|
|
1010
949
|
},
|
|
1011
950
|
{
|
|
1012
|
-
name:
|
|
1013
|
-
discriminator: [
|
|
951
|
+
"name": "collateralWithdrawn";
|
|
952
|
+
"discriminator": [
|
|
1014
953
|
51,
|
|
1015
954
|
224,
|
|
1016
955
|
133,
|
|
@@ -1022,8 +961,8 @@ type Jbond = {
|
|
|
1022
961
|
];
|
|
1023
962
|
},
|
|
1024
963
|
{
|
|
1025
|
-
name:
|
|
1026
|
-
discriminator: [
|
|
964
|
+
"name": "compensationClaimed";
|
|
965
|
+
"discriminator": [
|
|
1027
966
|
36,
|
|
1028
967
|
159,
|
|
1029
968
|
41,
|
|
@@ -1035,8 +974,8 @@ type Jbond = {
|
|
|
1035
974
|
];
|
|
1036
975
|
},
|
|
1037
976
|
{
|
|
1038
|
-
name:
|
|
1039
|
-
discriminator: [
|
|
977
|
+
"name": "validatorRegistered";
|
|
978
|
+
"discriminator": [
|
|
1040
979
|
20,
|
|
1041
980
|
20,
|
|
1042
981
|
190,
|
|
@@ -1048,198 +987,208 @@ type Jbond = {
|
|
|
1048
987
|
];
|
|
1049
988
|
}
|
|
1050
989
|
];
|
|
1051
|
-
errors: [
|
|
990
|
+
"errors": [
|
|
1052
991
|
{
|
|
1053
|
-
code: 6000;
|
|
1054
|
-
name:
|
|
1055
|
-
msg:
|
|
992
|
+
"code": 6000;
|
|
993
|
+
"name": "invalidVoteAccount";
|
|
994
|
+
"msg": "Invalid vote account";
|
|
1056
995
|
},
|
|
1057
996
|
{
|
|
1058
|
-
code: 6001;
|
|
1059
|
-
name:
|
|
1060
|
-
msg:
|
|
997
|
+
"code": 6001;
|
|
998
|
+
"name": "identityMismatch";
|
|
999
|
+
"msg": "Identity does not match vote account";
|
|
1061
1000
|
},
|
|
1062
1001
|
{
|
|
1063
|
-
code: 6002;
|
|
1064
|
-
name:
|
|
1065
|
-
msg:
|
|
1002
|
+
"code": 6002;
|
|
1003
|
+
"name": "insufficientCollateral";
|
|
1004
|
+
"msg": "Insufficient collateral amount";
|
|
1066
1005
|
},
|
|
1067
1006
|
{
|
|
1068
|
-
code: 6003;
|
|
1069
|
-
name:
|
|
1070
|
-
msg:
|
|
1007
|
+
"code": 6003;
|
|
1008
|
+
"name": "targetAprTooLow";
|
|
1009
|
+
"msg": "Target APR is below minimum threshold";
|
|
1071
1010
|
},
|
|
1072
1011
|
{
|
|
1073
|
-
code: 6004;
|
|
1074
|
-
name:
|
|
1075
|
-
msg:
|
|
1012
|
+
"code": 6004;
|
|
1013
|
+
"name": "mathOverflow";
|
|
1014
|
+
"msg": "Math overflow";
|
|
1076
1015
|
},
|
|
1077
1016
|
{
|
|
1078
|
-
code: 6005;
|
|
1079
|
-
name:
|
|
1080
|
-
msg:
|
|
1017
|
+
"code": 6005;
|
|
1018
|
+
"name": "invalidAmount";
|
|
1019
|
+
"msg": "Invalid amount";
|
|
1081
1020
|
},
|
|
1082
1021
|
{
|
|
1083
|
-
code: 6006;
|
|
1084
|
-
name:
|
|
1085
|
-
msg:
|
|
1022
|
+
"code": 6006;
|
|
1023
|
+
"name": "validatorNotActive";
|
|
1024
|
+
"msg": "Validator bond account is not active";
|
|
1086
1025
|
},
|
|
1087
1026
|
{
|
|
1088
|
-
code: 6007;
|
|
1089
|
-
name:
|
|
1090
|
-
msg:
|
|
1027
|
+
"code": 6007;
|
|
1028
|
+
"name": "validatorAlreadyRegistered";
|
|
1029
|
+
"msg": "Validator already registered";
|
|
1091
1030
|
},
|
|
1092
1031
|
{
|
|
1093
|
-
code: 6008;
|
|
1094
|
-
name:
|
|
1095
|
-
msg:
|
|
1032
|
+
"code": 6008;
|
|
1033
|
+
"name": "unauthorized";
|
|
1034
|
+
"msg": "unauthorized";
|
|
1096
1035
|
},
|
|
1097
1036
|
{
|
|
1098
|
-
code: 6009;
|
|
1099
|
-
name:
|
|
1100
|
-
msg:
|
|
1037
|
+
"code": 6009;
|
|
1038
|
+
"name": "withdrawalLockedNearEpochEnd";
|
|
1039
|
+
"msg": "Withdrawals are locked near the end of the epoch.";
|
|
1101
1040
|
},
|
|
1102
1041
|
{
|
|
1103
|
-
code: 6010;
|
|
1104
|
-
name:
|
|
1105
|
-
msg:
|
|
1042
|
+
"code": 6010;
|
|
1043
|
+
"name": "missingTokenAccounts";
|
|
1044
|
+
"msg": "Missing token accounts for token collateral type";
|
|
1106
1045
|
},
|
|
1107
1046
|
{
|
|
1108
|
-
code: 6011;
|
|
1109
|
-
name:
|
|
1110
|
-
msg:
|
|
1047
|
+
"code": 6011;
|
|
1048
|
+
"name": "missingTokenProgram";
|
|
1049
|
+
"msg": "Token program is required for token collateral type";
|
|
1111
1050
|
},
|
|
1112
1051
|
{
|
|
1113
|
-
code: 6012;
|
|
1114
|
-
name:
|
|
1115
|
-
msg:
|
|
1052
|
+
"code": 6012;
|
|
1053
|
+
"name": "invalidMint";
|
|
1054
|
+
"msg": "Invalid mint for token collateral type";
|
|
1116
1055
|
},
|
|
1117
1056
|
{
|
|
1118
|
-
code: 6013;
|
|
1119
|
-
name:
|
|
1120
|
-
msg:
|
|
1057
|
+
"code": 6013;
|
|
1058
|
+
"name": "missingStakeAccount";
|
|
1059
|
+
"msg": "Stake account is required for stake account collateral type";
|
|
1121
1060
|
},
|
|
1122
1061
|
{
|
|
1123
|
-
code: 6014;
|
|
1124
|
-
name:
|
|
1125
|
-
msg:
|
|
1062
|
+
"code": 6014;
|
|
1063
|
+
"name": "missingStakeProgram";
|
|
1064
|
+
"msg": "Stake program is required for stake account collateral type";
|
|
1126
1065
|
},
|
|
1127
1066
|
{
|
|
1128
|
-
code: 6015;
|
|
1129
|
-
name:
|
|
1130
|
-
msg:
|
|
1067
|
+
"code": 6015;
|
|
1068
|
+
"name": "bondFinished";
|
|
1069
|
+
"msg": "Bond is finished (deposits/withdrawals disabled)";
|
|
1131
1070
|
},
|
|
1132
1071
|
{
|
|
1133
|
-
code: 6016;
|
|
1134
|
-
name:
|
|
1135
|
-
msg:
|
|
1072
|
+
"code": 6016;
|
|
1073
|
+
"name": "bondNotFinished";
|
|
1074
|
+
"msg": "Bond is not finished";
|
|
1136
1075
|
},
|
|
1137
1076
|
{
|
|
1138
|
-
code: 6017;
|
|
1139
|
-
name:
|
|
1140
|
-
msg:
|
|
1077
|
+
"code": 6017;
|
|
1078
|
+
"name": "unsupportedCollateralType";
|
|
1079
|
+
"msg": "Unsupported collateral type";
|
|
1141
1080
|
},
|
|
1142
1081
|
{
|
|
1143
|
-
code: 6018;
|
|
1144
|
-
name:
|
|
1145
|
-
msg:
|
|
1082
|
+
"code": 6018;
|
|
1083
|
+
"name": "overflow";
|
|
1084
|
+
"msg": "Math operation overflowed";
|
|
1146
1085
|
},
|
|
1147
1086
|
{
|
|
1148
|
-
code: 6019;
|
|
1149
|
-
name:
|
|
1150
|
-
msg:
|
|
1087
|
+
"code": 6019;
|
|
1088
|
+
"name": "incorrectBondType";
|
|
1089
|
+
"msg": "Incorrect bond type for this operation";
|
|
1151
1090
|
},
|
|
1152
1091
|
{
|
|
1153
|
-
code: 6020;
|
|
1154
|
-
name:
|
|
1155
|
-
msg:
|
|
1092
|
+
"code": 6020;
|
|
1093
|
+
"name": "bondNotFinishable";
|
|
1094
|
+
"msg": "This bond type can't be finished";
|
|
1156
1095
|
},
|
|
1157
1096
|
{
|
|
1158
|
-
code: 6021;
|
|
1159
|
-
name:
|
|
1160
|
-
msg:
|
|
1097
|
+
"code": 6021;
|
|
1098
|
+
"name": "invalidArgument";
|
|
1099
|
+
"msg": "Invalid argument provided";
|
|
1161
1100
|
},
|
|
1162
1101
|
{
|
|
1163
|
-
code: 6022;
|
|
1164
|
-
name:
|
|
1165
|
-
msg:
|
|
1102
|
+
"code": 6022;
|
|
1103
|
+
"name": "bondNotDisabled";
|
|
1104
|
+
"msg": "Bond is not disabled";
|
|
1166
1105
|
},
|
|
1167
1106
|
{
|
|
1168
|
-
code: 6023;
|
|
1169
|
-
name:
|
|
1170
|
-
msg:
|
|
1107
|
+
"code": 6023;
|
|
1108
|
+
"name": "bondNotEnabled";
|
|
1109
|
+
"msg": "Bond is not enabled";
|
|
1171
1110
|
}
|
|
1172
1111
|
];
|
|
1173
|
-
types: [
|
|
1112
|
+
"types": [
|
|
1174
1113
|
{
|
|
1175
|
-
name:
|
|
1176
|
-
type: {
|
|
1177
|
-
kind:
|
|
1178
|
-
fields: [
|
|
1114
|
+
"name": "bondConfigureData";
|
|
1115
|
+
"type": {
|
|
1116
|
+
"kind": "struct";
|
|
1117
|
+
"fields": [
|
|
1179
1118
|
{
|
|
1180
|
-
name:
|
|
1181
|
-
type: {
|
|
1182
|
-
option:
|
|
1119
|
+
"name": "status";
|
|
1120
|
+
"type": {
|
|
1121
|
+
"option": {
|
|
1122
|
+
"defined": {
|
|
1123
|
+
"name": "bondStatus";
|
|
1124
|
+
};
|
|
1125
|
+
};
|
|
1183
1126
|
};
|
|
1184
1127
|
},
|
|
1185
1128
|
{
|
|
1186
|
-
name:
|
|
1187
|
-
type: {
|
|
1188
|
-
option:
|
|
1129
|
+
"name": "newReserve";
|
|
1130
|
+
"type": {
|
|
1131
|
+
"option": "pubkey";
|
|
1132
|
+
};
|
|
1133
|
+
},
|
|
1134
|
+
{
|
|
1135
|
+
"name": "newAuthority";
|
|
1136
|
+
"type": {
|
|
1137
|
+
"option": "pubkey";
|
|
1189
1138
|
};
|
|
1190
1139
|
}
|
|
1191
1140
|
];
|
|
1192
1141
|
};
|
|
1193
1142
|
},
|
|
1194
1143
|
{
|
|
1195
|
-
name:
|
|
1196
|
-
type: {
|
|
1197
|
-
kind:
|
|
1198
|
-
fields: [
|
|
1144
|
+
"name": "bondFinished";
|
|
1145
|
+
"type": {
|
|
1146
|
+
"kind": "struct";
|
|
1147
|
+
"fields": [
|
|
1199
1148
|
{
|
|
1200
|
-
name:
|
|
1201
|
-
type:
|
|
1149
|
+
"name": "bond";
|
|
1150
|
+
"type": "pubkey";
|
|
1202
1151
|
},
|
|
1203
1152
|
{
|
|
1204
|
-
name:
|
|
1205
|
-
type:
|
|
1153
|
+
"name": "authority";
|
|
1154
|
+
"type": "pubkey";
|
|
1206
1155
|
},
|
|
1207
1156
|
{
|
|
1208
|
-
name:
|
|
1209
|
-
type:
|
|
1157
|
+
"name": "timestamp";
|
|
1158
|
+
"type": "i64";
|
|
1210
1159
|
}
|
|
1211
1160
|
];
|
|
1212
1161
|
};
|
|
1213
1162
|
},
|
|
1214
1163
|
{
|
|
1215
|
-
name:
|
|
1216
|
-
docs: [
|
|
1217
|
-
|
|
1164
|
+
"name": "bondInitializeData";
|
|
1165
|
+
"docs": [
|
|
1166
|
+
"Data required to initialize a performance bond"
|
|
1218
1167
|
];
|
|
1219
|
-
type: {
|
|
1220
|
-
kind:
|
|
1221
|
-
fields: [
|
|
1168
|
+
"type": {
|
|
1169
|
+
"kind": "struct";
|
|
1170
|
+
"fields": [
|
|
1222
1171
|
{
|
|
1223
|
-
name:
|
|
1224
|
-
type:
|
|
1172
|
+
"name": "name";
|
|
1173
|
+
"type": "string";
|
|
1225
1174
|
},
|
|
1226
1175
|
{
|
|
1227
|
-
name:
|
|
1228
|
-
type: {
|
|
1229
|
-
defined: {
|
|
1230
|
-
name:
|
|
1176
|
+
"name": "bondType";
|
|
1177
|
+
"type": {
|
|
1178
|
+
"defined": {
|
|
1179
|
+
"name": "bondType";
|
|
1231
1180
|
};
|
|
1232
1181
|
};
|
|
1233
1182
|
},
|
|
1234
1183
|
{
|
|
1235
|
-
name:
|
|
1236
|
-
type:
|
|
1184
|
+
"name": "reserve";
|
|
1185
|
+
"type": "pubkey";
|
|
1237
1186
|
},
|
|
1238
1187
|
{
|
|
1239
|
-
name:
|
|
1240
|
-
type: {
|
|
1241
|
-
defined: {
|
|
1242
|
-
name:
|
|
1188
|
+
"name": "collateralType";
|
|
1189
|
+
"type": {
|
|
1190
|
+
"defined": {
|
|
1191
|
+
"name": "collateralType";
|
|
1243
1192
|
};
|
|
1244
1193
|
};
|
|
1245
1194
|
}
|
|
@@ -1247,356 +1196,359 @@ type Jbond = {
|
|
|
1247
1196
|
};
|
|
1248
1197
|
},
|
|
1249
1198
|
{
|
|
1250
|
-
name:
|
|
1251
|
-
type: {
|
|
1252
|
-
kind:
|
|
1253
|
-
fields: [
|
|
1199
|
+
"name": "bondStarted";
|
|
1200
|
+
"type": {
|
|
1201
|
+
"kind": "struct";
|
|
1202
|
+
"fields": [
|
|
1254
1203
|
{
|
|
1255
|
-
name:
|
|
1256
|
-
type:
|
|
1204
|
+
"name": "bond";
|
|
1205
|
+
"type": "pubkey";
|
|
1257
1206
|
},
|
|
1258
1207
|
{
|
|
1259
|
-
name:
|
|
1260
|
-
type:
|
|
1208
|
+
"name": "authority";
|
|
1209
|
+
"type": "pubkey";
|
|
1261
1210
|
},
|
|
1262
1211
|
{
|
|
1263
|
-
name:
|
|
1264
|
-
type:
|
|
1212
|
+
"name": "timestamp";
|
|
1213
|
+
"type": "i64";
|
|
1265
1214
|
}
|
|
1266
1215
|
];
|
|
1267
1216
|
};
|
|
1268
1217
|
},
|
|
1269
1218
|
{
|
|
1270
|
-
name:
|
|
1271
|
-
type: {
|
|
1272
|
-
kind:
|
|
1273
|
-
fields: [
|
|
1219
|
+
"name": "bondState";
|
|
1220
|
+
"type": {
|
|
1221
|
+
"kind": "struct";
|
|
1222
|
+
"fields": [
|
|
1274
1223
|
{
|
|
1275
|
-
name:
|
|
1276
|
-
type:
|
|
1224
|
+
"name": "name";
|
|
1225
|
+
"type": "string";
|
|
1277
1226
|
},
|
|
1278
1227
|
{
|
|
1279
|
-
name:
|
|
1280
|
-
docs: [
|
|
1281
|
-
|
|
1228
|
+
"name": "bondType";
|
|
1229
|
+
"docs": [
|
|
1230
|
+
"The type of bond (e.g., Performance, Crowdfunding)"
|
|
1282
1231
|
];
|
|
1283
|
-
type: {
|
|
1284
|
-
defined: {
|
|
1285
|
-
name:
|
|
1232
|
+
"type": {
|
|
1233
|
+
"defined": {
|
|
1234
|
+
"name": "bondType";
|
|
1286
1235
|
};
|
|
1287
1236
|
};
|
|
1288
1237
|
},
|
|
1289
1238
|
{
|
|
1290
|
-
name:
|
|
1291
|
-
docs: [
|
|
1292
|
-
|
|
1239
|
+
"name": "collateralType";
|
|
1240
|
+
"docs": [
|
|
1241
|
+
"The type of collateral accepted for this bond"
|
|
1293
1242
|
];
|
|
1294
|
-
type: {
|
|
1295
|
-
defined: {
|
|
1296
|
-
name:
|
|
1243
|
+
"type": {
|
|
1244
|
+
"defined": {
|
|
1245
|
+
"name": "collateralType";
|
|
1297
1246
|
};
|
|
1298
1247
|
};
|
|
1299
1248
|
},
|
|
1300
1249
|
{
|
|
1301
|
-
name:
|
|
1302
|
-
docs: [
|
|
1303
|
-
|
|
1250
|
+
"name": "reserve";
|
|
1251
|
+
"docs": [
|
|
1252
|
+
"Reserve account where collateral is held"
|
|
1304
1253
|
];
|
|
1305
|
-
type:
|
|
1254
|
+
"type": "pubkey";
|
|
1306
1255
|
},
|
|
1307
1256
|
{
|
|
1308
|
-
name:
|
|
1309
|
-
docs: [
|
|
1310
|
-
|
|
1257
|
+
"name": "authority";
|
|
1258
|
+
"docs": [
|
|
1259
|
+
"Authority allowed to manage the bond configuration"
|
|
1311
1260
|
];
|
|
1312
|
-
type:
|
|
1261
|
+
"type": "pubkey";
|
|
1313
1262
|
},
|
|
1314
1263
|
{
|
|
1315
|
-
name:
|
|
1316
|
-
docs: [
|
|
1317
|
-
|
|
1264
|
+
"name": "sessionId";
|
|
1265
|
+
"docs": [
|
|
1266
|
+
"Unique identifier for the bonding session"
|
|
1318
1267
|
];
|
|
1319
|
-
type:
|
|
1268
|
+
"type": "u32";
|
|
1320
1269
|
},
|
|
1321
1270
|
{
|
|
1322
|
-
name:
|
|
1323
|
-
docs: [
|
|
1324
|
-
|
|
1271
|
+
"name": "totalMembers";
|
|
1272
|
+
"docs": [
|
|
1273
|
+
"Total number of users who have participated in the bond"
|
|
1325
1274
|
];
|
|
1326
|
-
type:
|
|
1275
|
+
"type": "u16";
|
|
1327
1276
|
},
|
|
1328
1277
|
{
|
|
1329
|
-
name:
|
|
1330
|
-
docs: [
|
|
1331
|
-
|
|
1278
|
+
"name": "totalCompensationAmount";
|
|
1279
|
+
"docs": [
|
|
1280
|
+
"Total compensation amount paid out"
|
|
1332
1281
|
];
|
|
1333
|
-
type:
|
|
1282
|
+
"type": "u64";
|
|
1334
1283
|
},
|
|
1335
1284
|
{
|
|
1336
|
-
name:
|
|
1337
|
-
docs: [
|
|
1338
|
-
|
|
1285
|
+
"name": "sessionStartTs";
|
|
1286
|
+
"docs": [
|
|
1287
|
+
"Start timestamp of the current session (unix seconds). 0 — not set."
|
|
1339
1288
|
];
|
|
1340
|
-
type:
|
|
1289
|
+
"type": "i64";
|
|
1341
1290
|
},
|
|
1342
1291
|
{
|
|
1343
|
-
name:
|
|
1344
|
-
docs: [
|
|
1345
|
-
|
|
1292
|
+
"name": "sessionFinishTs";
|
|
1293
|
+
"docs": [
|
|
1294
|
+
"Finish timestamp of the current session (unix seconds). 0 — not set."
|
|
1346
1295
|
];
|
|
1347
|
-
type:
|
|
1296
|
+
"type": "i64";
|
|
1348
1297
|
},
|
|
1349
1298
|
{
|
|
1350
|
-
name:
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1299
|
+
"name": "status";
|
|
1300
|
+
"docs": [
|
|
1301
|
+
"Current status of the bond"
|
|
1302
|
+
];
|
|
1303
|
+
"type": {
|
|
1304
|
+
"defined": {
|
|
1305
|
+
"name": "bondStatus";
|
|
1354
1306
|
};
|
|
1355
1307
|
};
|
|
1356
1308
|
},
|
|
1357
1309
|
{
|
|
1358
|
-
name:
|
|
1359
|
-
docs: [
|
|
1360
|
-
|
|
1310
|
+
"name": "bump";
|
|
1311
|
+
"docs": [
|
|
1312
|
+
"Bump for the PDA"
|
|
1361
1313
|
];
|
|
1362
|
-
type:
|
|
1314
|
+
"type": "u8";
|
|
1363
1315
|
}
|
|
1364
1316
|
];
|
|
1365
1317
|
};
|
|
1366
1318
|
},
|
|
1367
1319
|
{
|
|
1368
|
-
name:
|
|
1369
|
-
type: {
|
|
1370
|
-
kind:
|
|
1371
|
-
variants: [
|
|
1320
|
+
"name": "bondStatus";
|
|
1321
|
+
"type": {
|
|
1322
|
+
"kind": "enum";
|
|
1323
|
+
"variants": [
|
|
1372
1324
|
{
|
|
1373
|
-
name:
|
|
1325
|
+
"name": "active";
|
|
1374
1326
|
},
|
|
1375
1327
|
{
|
|
1376
|
-
name:
|
|
1328
|
+
"name": "disabled";
|
|
1377
1329
|
}
|
|
1378
1330
|
];
|
|
1379
1331
|
};
|
|
1380
1332
|
},
|
|
1381
1333
|
{
|
|
1382
|
-
name:
|
|
1383
|
-
docs: [
|
|
1384
|
-
|
|
1334
|
+
"name": "bondType";
|
|
1335
|
+
"docs": [
|
|
1336
|
+
"Types of bonds supported by the program"
|
|
1385
1337
|
];
|
|
1386
|
-
type: {
|
|
1387
|
-
kind:
|
|
1388
|
-
variants: [
|
|
1338
|
+
"type": {
|
|
1339
|
+
"kind": "enum";
|
|
1340
|
+
"variants": [
|
|
1389
1341
|
{
|
|
1390
|
-
name:
|
|
1342
|
+
"name": "performance";
|
|
1391
1343
|
},
|
|
1392
1344
|
{
|
|
1393
|
-
name:
|
|
1345
|
+
"name": "crowdfunding";
|
|
1394
1346
|
}
|
|
1395
1347
|
];
|
|
1396
1348
|
};
|
|
1397
1349
|
},
|
|
1398
1350
|
{
|
|
1399
|
-
name:
|
|
1400
|
-
type: {
|
|
1401
|
-
kind:
|
|
1402
|
-
fields: [
|
|
1351
|
+
"name": "collateralToppedUp";
|
|
1352
|
+
"type": {
|
|
1353
|
+
"kind": "struct";
|
|
1354
|
+
"fields": [
|
|
1403
1355
|
{
|
|
1404
|
-
name:
|
|
1405
|
-
type:
|
|
1356
|
+
"name": "validator";
|
|
1357
|
+
"type": "pubkey";
|
|
1406
1358
|
},
|
|
1407
1359
|
{
|
|
1408
|
-
name:
|
|
1409
|
-
type:
|
|
1360
|
+
"name": "amount";
|
|
1361
|
+
"type": "u64";
|
|
1410
1362
|
},
|
|
1411
1363
|
{
|
|
1412
|
-
name:
|
|
1413
|
-
type:
|
|
1364
|
+
"name": "postBalance";
|
|
1365
|
+
"type": "u64";
|
|
1414
1366
|
},
|
|
1415
1367
|
{
|
|
1416
|
-
name:
|
|
1417
|
-
type:
|
|
1368
|
+
"name": "timestamp";
|
|
1369
|
+
"type": "i64";
|
|
1418
1370
|
}
|
|
1419
1371
|
];
|
|
1420
1372
|
};
|
|
1421
1373
|
},
|
|
1422
1374
|
{
|
|
1423
|
-
name:
|
|
1424
|
-
docs: [
|
|
1425
|
-
|
|
1375
|
+
"name": "collateralType";
|
|
1376
|
+
"docs": [
|
|
1377
|
+
"Types of collateral that can be used for bond deposit"
|
|
1426
1378
|
];
|
|
1427
|
-
type: {
|
|
1428
|
-
kind:
|
|
1429
|
-
variants: [
|
|
1379
|
+
"type": {
|
|
1380
|
+
"kind": "enum";
|
|
1381
|
+
"variants": [
|
|
1430
1382
|
{
|
|
1431
|
-
name:
|
|
1383
|
+
"name": "native";
|
|
1432
1384
|
},
|
|
1433
1385
|
{
|
|
1434
|
-
name:
|
|
1386
|
+
"name": "stakeAccount";
|
|
1435
1387
|
},
|
|
1436
1388
|
{
|
|
1437
|
-
name:
|
|
1438
|
-
fields: [
|
|
1439
|
-
|
|
1389
|
+
"name": "token";
|
|
1390
|
+
"fields": [
|
|
1391
|
+
"pubkey"
|
|
1440
1392
|
];
|
|
1441
1393
|
}
|
|
1442
1394
|
];
|
|
1443
1395
|
};
|
|
1444
1396
|
},
|
|
1445
1397
|
{
|
|
1446
|
-
name:
|
|
1447
|
-
type: {
|
|
1448
|
-
kind:
|
|
1449
|
-
fields: [
|
|
1398
|
+
"name": "collateralWithdrawn";
|
|
1399
|
+
"type": {
|
|
1400
|
+
"kind": "struct";
|
|
1401
|
+
"fields": [
|
|
1450
1402
|
{
|
|
1451
|
-
name:
|
|
1452
|
-
type:
|
|
1403
|
+
"name": "validator";
|
|
1404
|
+
"type": "pubkey";
|
|
1453
1405
|
},
|
|
1454
1406
|
{
|
|
1455
|
-
name:
|
|
1456
|
-
type:
|
|
1407
|
+
"name": "amount";
|
|
1408
|
+
"type": "u64";
|
|
1457
1409
|
},
|
|
1458
1410
|
{
|
|
1459
|
-
name:
|
|
1460
|
-
type:
|
|
1411
|
+
"name": "postBalance";
|
|
1412
|
+
"type": "u64";
|
|
1461
1413
|
},
|
|
1462
1414
|
{
|
|
1463
|
-
name:
|
|
1464
|
-
type:
|
|
1415
|
+
"name": "timestamp";
|
|
1416
|
+
"type": "i64";
|
|
1465
1417
|
}
|
|
1466
1418
|
];
|
|
1467
1419
|
};
|
|
1468
1420
|
},
|
|
1469
1421
|
{
|
|
1470
|
-
name:
|
|
1471
|
-
type: {
|
|
1472
|
-
kind:
|
|
1473
|
-
fields: [
|
|
1422
|
+
"name": "compensationClaimed";
|
|
1423
|
+
"type": {
|
|
1424
|
+
"kind": "struct";
|
|
1425
|
+
"fields": [
|
|
1474
1426
|
{
|
|
1475
|
-
name:
|
|
1476
|
-
type:
|
|
1427
|
+
"name": "validator";
|
|
1428
|
+
"type": "pubkey";
|
|
1477
1429
|
},
|
|
1478
1430
|
{
|
|
1479
|
-
name:
|
|
1480
|
-
type:
|
|
1431
|
+
"name": "amount";
|
|
1432
|
+
"type": "u64";
|
|
1481
1433
|
},
|
|
1482
1434
|
{
|
|
1483
|
-
name:
|
|
1484
|
-
type:
|
|
1435
|
+
"name": "postBalance";
|
|
1436
|
+
"type": "u64";
|
|
1485
1437
|
},
|
|
1486
1438
|
{
|
|
1487
|
-
name:
|
|
1488
|
-
type:
|
|
1439
|
+
"name": "epoch";
|
|
1440
|
+
"type": "u64";
|
|
1489
1441
|
},
|
|
1490
1442
|
{
|
|
1491
|
-
name:
|
|
1492
|
-
type:
|
|
1443
|
+
"name": "timestamp";
|
|
1444
|
+
"type": "i64";
|
|
1493
1445
|
}
|
|
1494
1446
|
];
|
|
1495
1447
|
};
|
|
1496
1448
|
},
|
|
1497
1449
|
{
|
|
1498
|
-
name:
|
|
1499
|
-
type: {
|
|
1500
|
-
kind:
|
|
1501
|
-
fields: [
|
|
1450
|
+
"name": "globalConfigureData";
|
|
1451
|
+
"type": {
|
|
1452
|
+
"kind": "struct";
|
|
1453
|
+
"fields": [
|
|
1502
1454
|
{
|
|
1503
|
-
name:
|
|
1504
|
-
type: {
|
|
1505
|
-
option:
|
|
1455
|
+
"name": "newAuthority";
|
|
1456
|
+
"type": {
|
|
1457
|
+
"option": "pubkey";
|
|
1506
1458
|
};
|
|
1507
1459
|
}
|
|
1508
1460
|
];
|
|
1509
1461
|
};
|
|
1510
1462
|
},
|
|
1511
1463
|
{
|
|
1512
|
-
name:
|
|
1513
|
-
type: {
|
|
1514
|
-
kind:
|
|
1515
|
-
fields: [
|
|
1464
|
+
"name": "globalState";
|
|
1465
|
+
"type": {
|
|
1466
|
+
"kind": "struct";
|
|
1467
|
+
"fields": [
|
|
1516
1468
|
{
|
|
1517
|
-
name:
|
|
1518
|
-
docs: [
|
|
1519
|
-
|
|
1469
|
+
"name": "authority";
|
|
1470
|
+
"docs": [
|
|
1471
|
+
"The authority allowed to manage the program"
|
|
1520
1472
|
];
|
|
1521
|
-
type:
|
|
1473
|
+
"type": "pubkey";
|
|
1522
1474
|
},
|
|
1523
1475
|
{
|
|
1524
|
-
name:
|
|
1525
|
-
docs: [
|
|
1526
|
-
|
|
1476
|
+
"name": "bump";
|
|
1477
|
+
"docs": [
|
|
1478
|
+
"Bump for the PDA"
|
|
1527
1479
|
];
|
|
1528
|
-
type:
|
|
1480
|
+
"type": "u8";
|
|
1529
1481
|
}
|
|
1530
1482
|
];
|
|
1531
1483
|
};
|
|
1532
1484
|
},
|
|
1533
1485
|
{
|
|
1534
|
-
name:
|
|
1535
|
-
type: {
|
|
1536
|
-
kind:
|
|
1537
|
-
fields: [
|
|
1486
|
+
"name": "validatorBond";
|
|
1487
|
+
"type": {
|
|
1488
|
+
"kind": "struct";
|
|
1489
|
+
"fields": [
|
|
1538
1490
|
{
|
|
1539
|
-
name:
|
|
1540
|
-
type:
|
|
1491
|
+
"name": "state";
|
|
1492
|
+
"type": "pubkey";
|
|
1541
1493
|
},
|
|
1542
1494
|
{
|
|
1543
|
-
name:
|
|
1544
|
-
type:
|
|
1495
|
+
"name": "identity";
|
|
1496
|
+
"type": "pubkey";
|
|
1545
1497
|
},
|
|
1546
1498
|
{
|
|
1547
|
-
name:
|
|
1548
|
-
type:
|
|
1499
|
+
"name": "voteAccount";
|
|
1500
|
+
"type": "pubkey";
|
|
1549
1501
|
},
|
|
1550
1502
|
{
|
|
1551
|
-
name:
|
|
1552
|
-
type:
|
|
1503
|
+
"name": "creator";
|
|
1504
|
+
"type": "pubkey";
|
|
1553
1505
|
},
|
|
1554
1506
|
{
|
|
1555
|
-
name:
|
|
1556
|
-
type: {
|
|
1557
|
-
option:
|
|
1507
|
+
"name": "withdrawalAuthority";
|
|
1508
|
+
"type": {
|
|
1509
|
+
"option": "pubkey";
|
|
1558
1510
|
};
|
|
1559
1511
|
},
|
|
1560
1512
|
{
|
|
1561
|
-
name:
|
|
1562
|
-
type:
|
|
1513
|
+
"name": "createdAt";
|
|
1514
|
+
"type": "i64";
|
|
1563
1515
|
},
|
|
1564
1516
|
{
|
|
1565
|
-
name:
|
|
1566
|
-
type:
|
|
1517
|
+
"name": "bump";
|
|
1518
|
+
"type": "u8";
|
|
1567
1519
|
}
|
|
1568
1520
|
];
|
|
1569
1521
|
};
|
|
1570
1522
|
},
|
|
1571
1523
|
{
|
|
1572
|
-
name:
|
|
1573
|
-
type: {
|
|
1574
|
-
kind:
|
|
1575
|
-
fields: [
|
|
1524
|
+
"name": "validatorRegistered";
|
|
1525
|
+
"type": {
|
|
1526
|
+
"kind": "struct";
|
|
1527
|
+
"fields": [
|
|
1576
1528
|
{
|
|
1577
|
-
name:
|
|
1578
|
-
type:
|
|
1529
|
+
"name": "identity";
|
|
1530
|
+
"type": "pubkey";
|
|
1579
1531
|
},
|
|
1580
1532
|
{
|
|
1581
|
-
name:
|
|
1582
|
-
type:
|
|
1533
|
+
"name": "voteAccount";
|
|
1534
|
+
"type": "pubkey";
|
|
1583
1535
|
},
|
|
1584
1536
|
{
|
|
1585
|
-
name:
|
|
1586
|
-
type:
|
|
1537
|
+
"name": "timestamp";
|
|
1538
|
+
"type": "i64";
|
|
1587
1539
|
}
|
|
1588
1540
|
];
|
|
1589
1541
|
};
|
|
1590
1542
|
}
|
|
1591
1543
|
];
|
|
1592
|
-
constants: [
|
|
1544
|
+
"constants": [
|
|
1593
1545
|
{
|
|
1594
|
-
name:
|
|
1595
|
-
docs: [
|
|
1596
|
-
|
|
1546
|
+
"name": "epochLockedSlotTail";
|
|
1547
|
+
"docs": [
|
|
1548
|
+
"Epoch slot index at the end of an epoch after which withdrawals are locked"
|
|
1597
1549
|
];
|
|
1598
|
-
type:
|
|
1599
|
-
value:
|
|
1550
|
+
"type": "u64";
|
|
1551
|
+
"value": "420000";
|
|
1600
1552
|
}
|
|
1601
1553
|
];
|
|
1602
1554
|
};
|
|
@@ -1606,6 +1558,7 @@ type BondState = IdlAccounts<Jbond>['bondState'];
|
|
|
1606
1558
|
type ValidatorBond = IdlAccounts<Jbond>['validatorBond'];
|
|
1607
1559
|
type BondType = IdlTypes<Jbond>['bondType'];
|
|
1608
1560
|
type CollateralType = IdlTypes<Jbond>['collateralType'];
|
|
1561
|
+
type BondStateStatus = IdlTypes<Jbond>['bondStatus'];
|
|
1609
1562
|
type BondStateStats = {
|
|
1610
1563
|
totalCollected: number;
|
|
1611
1564
|
status: SessionStatus;
|
|
@@ -1618,6 +1571,10 @@ declare const BondTypeVariant: {
|
|
|
1618
1571
|
Performance: BondType;
|
|
1619
1572
|
Crowdfunding: BondType;
|
|
1620
1573
|
};
|
|
1574
|
+
declare const BondStateStatusVariant: {
|
|
1575
|
+
Active: BondStateStatus;
|
|
1576
|
+
Disabled: BondStateStatus;
|
|
1577
|
+
};
|
|
1621
1578
|
type GlobalInitializeProps = {
|
|
1622
1579
|
authority?: PublicKey;
|
|
1623
1580
|
};
|
|
@@ -1675,6 +1632,7 @@ type BondConfigureProps = {
|
|
|
1675
1632
|
bondType: BondType;
|
|
1676
1633
|
name: string;
|
|
1677
1634
|
authority?: PublicKey;
|
|
1635
|
+
bondStateStatus?: BondStateStatus;
|
|
1678
1636
|
newAuthority?: PublicKey;
|
|
1679
1637
|
newReserve?: PublicKey;
|
|
1680
1638
|
};
|
|
@@ -1865,14 +1823,6 @@ declare class JBondClient {
|
|
|
1865
1823
|
bondType: BondType;
|
|
1866
1824
|
name: string;
|
|
1867
1825
|
}): Promise<string | undefined>;
|
|
1868
|
-
bondEnable(props: {
|
|
1869
|
-
bondType: BondType;
|
|
1870
|
-
name: string;
|
|
1871
|
-
}): Promise<string | undefined>;
|
|
1872
|
-
bondDisable(props: {
|
|
1873
|
-
bondType: BondType;
|
|
1874
|
-
name: string;
|
|
1875
|
-
}): Promise<string | undefined>;
|
|
1876
1826
|
buildBondGlobalStateInitializeIx(props: GlobalInitializeProps): Promise<TransactionInstruction>;
|
|
1877
1827
|
/**
|
|
1878
1828
|
* Build configure instruction
|
|
@@ -1897,14 +1847,6 @@ declare class JBondClient {
|
|
|
1897
1847
|
name: string;
|
|
1898
1848
|
duration_secs: number;
|
|
1899
1849
|
}): Promise<TransactionInstruction>;
|
|
1900
|
-
buildBondEnableIx(props: {
|
|
1901
|
-
bondType: BondType;
|
|
1902
|
-
name: string;
|
|
1903
|
-
}): Promise<TransactionInstruction>;
|
|
1904
|
-
buildBondDisableIx(props: {
|
|
1905
|
-
bondType: BondType;
|
|
1906
|
-
name: string;
|
|
1907
|
-
}): Promise<TransactionInstruction>;
|
|
1908
1850
|
/**
|
|
1909
1851
|
* Fetch global state or throw if not found
|
|
1910
1852
|
*/
|
|
@@ -1915,11 +1857,66 @@ declare class JBondClient {
|
|
|
1915
1857
|
* @param bondName - Name of the bond
|
|
1916
1858
|
* @param withStats
|
|
1917
1859
|
*/
|
|
1918
|
-
getBondState(bondType: BondType, bondName: string, withStats?: boolean): Promise<
|
|
1860
|
+
getBondState(bondType: BondType, bondName: string, withStats?: boolean): Promise<{
|
|
1861
|
+
bond_state: BondState;
|
|
1862
|
+
state_stats: BondStateStats | null;
|
|
1863
|
+
}>;
|
|
1919
1864
|
/**
|
|
1920
1865
|
* Get all bond states with total collected collateral
|
|
1921
1866
|
*/
|
|
1922
|
-
getAllBondStates(bondType: BondType, session_status?: SessionStatus): Promise<
|
|
1867
|
+
getAllBondStates(bondType: BondType, session_status?: SessionStatus): Promise<{
|
|
1868
|
+
bond_state: {
|
|
1869
|
+
name: string;
|
|
1870
|
+
bondType: ({
|
|
1871
|
+
crowdfunding?: undefined;
|
|
1872
|
+
} & {
|
|
1873
|
+
performance: Record<string, never>;
|
|
1874
|
+
}) | ({
|
|
1875
|
+
performance?: undefined;
|
|
1876
|
+
} & {
|
|
1877
|
+
crowdfunding: Record<string, never>;
|
|
1878
|
+
});
|
|
1879
|
+
collateralType: ({
|
|
1880
|
+
native?: undefined;
|
|
1881
|
+
token?: undefined;
|
|
1882
|
+
} & {
|
|
1883
|
+
stakeAccount: Record<string, never>;
|
|
1884
|
+
}) | ({
|
|
1885
|
+
stakeAccount?: undefined;
|
|
1886
|
+
token?: undefined;
|
|
1887
|
+
} & {
|
|
1888
|
+
native: Record<string, never>;
|
|
1889
|
+
}) | ({
|
|
1890
|
+
stakeAccount?: undefined;
|
|
1891
|
+
native?: undefined;
|
|
1892
|
+
} & {
|
|
1893
|
+
token: {
|
|
1894
|
+
0: PublicKey;
|
|
1895
|
+
};
|
|
1896
|
+
});
|
|
1897
|
+
reserve: PublicKey;
|
|
1898
|
+
authority: PublicKey;
|
|
1899
|
+
sessionId: number;
|
|
1900
|
+
totalMembers: number;
|
|
1901
|
+
totalCompensationAmount: bn_js;
|
|
1902
|
+
sessionStartTs: bn_js;
|
|
1903
|
+
sessionFinishTs: bn_js;
|
|
1904
|
+
status: ({
|
|
1905
|
+
disabled?: undefined;
|
|
1906
|
+
} & {
|
|
1907
|
+
active: Record<string, never>;
|
|
1908
|
+
}) | ({
|
|
1909
|
+
active?: undefined;
|
|
1910
|
+
} & {
|
|
1911
|
+
disabled: Record<string, never>;
|
|
1912
|
+
});
|
|
1913
|
+
bump: number;
|
|
1914
|
+
};
|
|
1915
|
+
state_stats: {
|
|
1916
|
+
totalCollected: number;
|
|
1917
|
+
status: SessionStatus;
|
|
1918
|
+
};
|
|
1919
|
+
}[]>;
|
|
1923
1920
|
/**
|
|
1924
1921
|
* Get session status for bond state
|
|
1925
1922
|
*/
|
|
@@ -1974,4 +1971,4 @@ declare class JBondClient {
|
|
|
1974
1971
|
private lamports;
|
|
1975
1972
|
}
|
|
1976
1973
|
|
|
1977
|
-
export { BondClientEnv, type BondCollateral, type BondConfigureProps, type BondInitializeProps, type BondState, type BondStateStats, BondTransactionType, type BondType, BondTypeVariant, type ClaimProps, type ClientOptions, type CollateralType, ENV_PROGRAM_ID, type EpochHistoryItem, type GetHistoryGroupedProps, type GetHistoryProps, type GlobalConfigureProps, type GlobalInitializeProps, type GlobalState, JBondClient, JPOOL_STAKE_POOL, type Jbond, NodeWallet, type RegisterValidatorProps, Seeds, SessionStatus, type SetWithdrawAuthorityProps, type TopUpCollateralProps, type TransactionHistoryItem, type ValidatorBond, type WithdrawCollateralProps, bondTypeToSeed };
|
|
1974
|
+
export { BondClientEnv, type BondCollateral, type BondConfigureProps, type BondInitializeProps, type BondState, type BondStateStats, type BondStateStatus, BondStateStatusVariant, BondTransactionType, type BondType, BondTypeVariant, type ClaimProps, type ClientOptions, type CollateralType, ENV_PROGRAM_ID, type EpochHistoryItem, type GetHistoryGroupedProps, type GetHistoryProps, type GlobalConfigureProps, type GlobalInitializeProps, type GlobalState, JBondClient, JPOOL_STAKE_POOL, type Jbond, NodeWallet, type RegisterValidatorProps, Seeds, SessionStatus, type SetWithdrawAuthorityProps, type TopUpCollateralProps, type TransactionHistoryItem, type ValidatorBond, type WithdrawCollateralProps, bondTypeToSeed };
|