@jpool/bond-sdk 0.10.3 → 0.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +878 -857
- package/dist/index.d.ts +878 -857
- package/dist/index.js +534 -721
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +524 -709
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -1,19 +1,8 @@
|
|
|
1
1
|
import * as bn_js from 'bn.js';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
declare enum Seeds {
|
|
7
|
-
GlobalState = "global_state",
|
|
8
|
-
BondState = "bond_state",
|
|
9
|
-
ValidatorBond = "validator_bond",
|
|
10
|
-
StandardBond = "standard",
|
|
11
|
-
CrowdFundingBond = "crowdfunding"
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Program IDs for different environments
|
|
15
|
-
*/
|
|
16
|
-
declare const ENV_PROGRAM_ID: Record<string, PublicKey>;
|
|
2
|
+
import * as _coral_xyz_anchor from '@coral-xyz/anchor';
|
|
3
|
+
import { IdlTypes, IdlAccounts, Provider, Program } from '@coral-xyz/anchor';
|
|
4
|
+
import * as _solana_web3_js from '@solana/web3.js';
|
|
5
|
+
import { PublicKey, PublicKeyInitData, Cluster, Transaction, VersionedTransaction, Keypair, Connection, TransactionInstruction } from '@solana/web3.js';
|
|
17
6
|
|
|
18
7
|
/**
|
|
19
8
|
* Program IDL in camelCase format in order to be used in JS/TS.
|
|
@@ -22,28 +11,28 @@ declare const ENV_PROGRAM_ID: Record<string, PublicKey>;
|
|
|
22
11
|
* IDL can be found at `target/idl/jbond.json`.
|
|
23
12
|
*/
|
|
24
13
|
type Jbond = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
14
|
+
address: 'BondQ7KqZreTcW2UbeTNDcLCJQ3aXAtLn2Fm6ftaJDU';
|
|
15
|
+
metadata: {
|
|
16
|
+
name: 'jbond';
|
|
17
|
+
version: '0.2.1';
|
|
18
|
+
spec: '0.1.0';
|
|
19
|
+
description: 'Jpool Bond Program';
|
|
31
20
|
};
|
|
32
|
-
|
|
21
|
+
instructions: [
|
|
33
22
|
{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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.'
|
|
45
34
|
];
|
|
46
|
-
|
|
35
|
+
discriminator: [
|
|
47
36
|
151,
|
|
48
37
|
92,
|
|
49
38
|
10,
|
|
@@ -53,19 +42,19 @@ type Jbond = {
|
|
|
53
42
|
188,
|
|
54
43
|
129
|
|
55
44
|
];
|
|
56
|
-
|
|
45
|
+
accounts: [
|
|
57
46
|
{
|
|
58
|
-
|
|
59
|
-
|
|
47
|
+
name: 'bondState';
|
|
48
|
+
writable: true;
|
|
60
49
|
},
|
|
61
50
|
{
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
51
|
+
name: 'validatorBond';
|
|
52
|
+
writable: true;
|
|
53
|
+
pda: {
|
|
54
|
+
seeds: [
|
|
66
55
|
{
|
|
67
|
-
|
|
68
|
-
|
|
56
|
+
kind: 'const';
|
|
57
|
+
value: [
|
|
69
58
|
118,
|
|
70
59
|
97,
|
|
71
60
|
108,
|
|
@@ -83,68 +72,68 @@ type Jbond = {
|
|
|
83
72
|
];
|
|
84
73
|
},
|
|
85
74
|
{
|
|
86
|
-
|
|
87
|
-
|
|
75
|
+
kind: 'account';
|
|
76
|
+
path: 'bondState';
|
|
88
77
|
},
|
|
89
78
|
{
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
79
|
+
kind: 'account';
|
|
80
|
+
path: 'validator_bond.vote_account';
|
|
81
|
+
account: 'validatorBond';
|
|
93
82
|
}
|
|
94
83
|
];
|
|
95
84
|
};
|
|
96
85
|
},
|
|
97
86
|
{
|
|
98
|
-
|
|
99
|
-
|
|
87
|
+
name: 'reserve';
|
|
88
|
+
writable: true;
|
|
100
89
|
},
|
|
101
90
|
{
|
|
102
|
-
|
|
103
|
-
|
|
91
|
+
name: 'authority';
|
|
92
|
+
signer: true;
|
|
104
93
|
},
|
|
105
94
|
{
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
95
|
+
name: 'bondTokenAccount';
|
|
96
|
+
writable: true;
|
|
97
|
+
optional: true;
|
|
109
98
|
},
|
|
110
99
|
{
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
100
|
+
name: 'reserveTokenAccount';
|
|
101
|
+
writable: true;
|
|
102
|
+
optional: true;
|
|
114
103
|
},
|
|
115
104
|
{
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
105
|
+
name: 'stakeAccount';
|
|
106
|
+
writable: true;
|
|
107
|
+
optional: true;
|
|
119
108
|
},
|
|
120
109
|
{
|
|
121
|
-
|
|
122
|
-
|
|
110
|
+
name: 'systemProgram';
|
|
111
|
+
address: '11111111111111111111111111111111';
|
|
123
112
|
},
|
|
124
113
|
{
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
114
|
+
name: 'tokenProgram';
|
|
115
|
+
optional: true;
|
|
116
|
+
address: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
|
|
128
117
|
},
|
|
129
118
|
{
|
|
130
|
-
|
|
131
|
-
|
|
119
|
+
name: 'stakeProgram';
|
|
120
|
+
optional: true;
|
|
132
121
|
}
|
|
133
122
|
];
|
|
134
|
-
|
|
123
|
+
args: [
|
|
135
124
|
{
|
|
136
|
-
|
|
137
|
-
|
|
125
|
+
name: 'amount';
|
|
126
|
+
type: 'u64';
|
|
138
127
|
}
|
|
139
128
|
];
|
|
140
129
|
},
|
|
141
130
|
{
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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.'
|
|
146
135
|
];
|
|
147
|
-
|
|
136
|
+
discriminator: [
|
|
148
137
|
61,
|
|
149
138
|
42,
|
|
150
139
|
106,
|
|
@@ -154,41 +143,41 @@ type Jbond = {
|
|
|
154
143
|
65,
|
|
155
144
|
20
|
|
156
145
|
];
|
|
157
|
-
|
|
146
|
+
accounts: [
|
|
158
147
|
{
|
|
159
|
-
|
|
160
|
-
|
|
148
|
+
name: 'bondState';
|
|
149
|
+
writable: true;
|
|
161
150
|
},
|
|
162
151
|
{
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
152
|
+
name: 'authority';
|
|
153
|
+
signer: true;
|
|
154
|
+
relations: [
|
|
155
|
+
'bondState'
|
|
167
156
|
];
|
|
168
157
|
}
|
|
169
158
|
];
|
|
170
|
-
|
|
159
|
+
args: [
|
|
171
160
|
{
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
161
|
+
name: 'data';
|
|
162
|
+
type: {
|
|
163
|
+
defined: {
|
|
164
|
+
name: 'bondConfigureData';
|
|
176
165
|
};
|
|
177
166
|
};
|
|
178
167
|
}
|
|
179
168
|
];
|
|
180
169
|
},
|
|
181
170
|
{
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
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.'
|
|
190
179
|
];
|
|
191
|
-
|
|
180
|
+
discriminator: [
|
|
192
181
|
230,
|
|
193
182
|
3,
|
|
194
183
|
121,
|
|
@@ -198,15 +187,15 @@ type Jbond = {
|
|
|
198
187
|
175,
|
|
199
188
|
210
|
|
200
189
|
];
|
|
201
|
-
|
|
190
|
+
accounts: [
|
|
202
191
|
{
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
192
|
+
name: 'bondState';
|
|
193
|
+
writable: true;
|
|
194
|
+
pda: {
|
|
195
|
+
seeds: [
|
|
207
196
|
{
|
|
208
|
-
|
|
209
|
-
|
|
197
|
+
kind: 'const';
|
|
198
|
+
value: [
|
|
210
199
|
98,
|
|
211
200
|
111,
|
|
212
201
|
110,
|
|
@@ -220,72 +209,72 @@ type Jbond = {
|
|
|
220
209
|
];
|
|
221
210
|
},
|
|
222
211
|
{
|
|
223
|
-
|
|
224
|
-
|
|
212
|
+
kind: 'arg';
|
|
213
|
+
path: 'data.bond_type';
|
|
225
214
|
},
|
|
226
215
|
{
|
|
227
|
-
|
|
228
|
-
|
|
216
|
+
kind: 'arg';
|
|
217
|
+
path: 'data.name';
|
|
229
218
|
}
|
|
230
219
|
];
|
|
231
220
|
};
|
|
232
221
|
},
|
|
233
222
|
{
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
223
|
+
name: 'authority';
|
|
224
|
+
writable: true;
|
|
225
|
+
signer: true;
|
|
237
226
|
},
|
|
238
227
|
{
|
|
239
|
-
|
|
228
|
+
name: 'reserve';
|
|
240
229
|
},
|
|
241
230
|
{
|
|
242
|
-
|
|
243
|
-
|
|
231
|
+
name: 'associatedTokenProgram';
|
|
232
|
+
address: 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL';
|
|
244
233
|
},
|
|
245
234
|
{
|
|
246
|
-
|
|
247
|
-
|
|
235
|
+
name: 'systemProgram';
|
|
236
|
+
address: '11111111111111111111111111111111';
|
|
248
237
|
},
|
|
249
238
|
{
|
|
250
|
-
|
|
251
|
-
|
|
239
|
+
name: 'tokenProgram';
|
|
240
|
+
address: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
|
|
252
241
|
},
|
|
253
242
|
{
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
243
|
+
name: 'reserveTokenAccount';
|
|
244
|
+
writable: true;
|
|
245
|
+
optional: true;
|
|
257
246
|
},
|
|
258
247
|
{
|
|
259
|
-
|
|
260
|
-
|
|
248
|
+
name: 'mint';
|
|
249
|
+
optional: true;
|
|
261
250
|
}
|
|
262
251
|
];
|
|
263
|
-
|
|
252
|
+
args: [
|
|
264
253
|
{
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
254
|
+
name: 'data';
|
|
255
|
+
type: {
|
|
256
|
+
defined: {
|
|
257
|
+
name: 'bondInitializeData';
|
|
269
258
|
};
|
|
270
259
|
};
|
|
271
260
|
}
|
|
272
261
|
];
|
|
273
262
|
},
|
|
274
263
|
{
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
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.'
|
|
287
276
|
];
|
|
288
|
-
|
|
277
|
+
discriminator: [
|
|
289
278
|
117,
|
|
290
279
|
127,
|
|
291
280
|
78,
|
|
@@ -295,19 +284,19 @@ type Jbond = {
|
|
|
295
284
|
163,
|
|
296
285
|
83
|
|
297
286
|
];
|
|
298
|
-
|
|
287
|
+
accounts: [
|
|
299
288
|
{
|
|
300
|
-
|
|
301
|
-
|
|
289
|
+
name: 'bondState';
|
|
290
|
+
writable: true;
|
|
302
291
|
},
|
|
303
292
|
{
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
293
|
+
name: 'validatorBond';
|
|
294
|
+
writable: true;
|
|
295
|
+
pda: {
|
|
296
|
+
seeds: [
|
|
308
297
|
{
|
|
309
|
-
|
|
310
|
-
|
|
298
|
+
kind: 'const';
|
|
299
|
+
value: [
|
|
311
300
|
118,
|
|
312
301
|
97,
|
|
313
302
|
108,
|
|
@@ -325,78 +314,78 @@ type Jbond = {
|
|
|
325
314
|
];
|
|
326
315
|
},
|
|
327
316
|
{
|
|
328
|
-
|
|
329
|
-
|
|
317
|
+
kind: 'account';
|
|
318
|
+
path: 'bondState';
|
|
330
319
|
},
|
|
331
320
|
{
|
|
332
|
-
|
|
333
|
-
|
|
321
|
+
kind: 'account';
|
|
322
|
+
path: 'voteAccount';
|
|
334
323
|
}
|
|
335
324
|
];
|
|
336
325
|
};
|
|
337
326
|
},
|
|
338
327
|
{
|
|
339
|
-
|
|
328
|
+
name: 'identity';
|
|
340
329
|
},
|
|
341
330
|
{
|
|
342
|
-
|
|
331
|
+
name: 'voteAccount';
|
|
343
332
|
},
|
|
344
333
|
{
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
334
|
+
name: 'creator';
|
|
335
|
+
writable: true;
|
|
336
|
+
signer: true;
|
|
348
337
|
},
|
|
349
338
|
{
|
|
350
|
-
|
|
351
|
-
|
|
339
|
+
name: 'systemProgram';
|
|
340
|
+
address: '11111111111111111111111111111111';
|
|
352
341
|
},
|
|
353
342
|
{
|
|
354
|
-
|
|
355
|
-
|
|
343
|
+
name: 'tokenProgram';
|
|
344
|
+
address: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
|
|
356
345
|
},
|
|
357
346
|
{
|
|
358
|
-
|
|
359
|
-
|
|
347
|
+
name: 'associatedTokenProgram';
|
|
348
|
+
address: 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL';
|
|
360
349
|
},
|
|
361
350
|
{
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
351
|
+
name: 'bondTokenAccount';
|
|
352
|
+
writable: true;
|
|
353
|
+
optional: true;
|
|
365
354
|
},
|
|
366
355
|
{
|
|
367
|
-
|
|
368
|
-
|
|
356
|
+
name: 'mint';
|
|
357
|
+
optional: true;
|
|
369
358
|
}
|
|
370
359
|
];
|
|
371
|
-
|
|
360
|
+
args: [
|
|
372
361
|
{
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
362
|
+
name: 'bondType';
|
|
363
|
+
type: {
|
|
364
|
+
defined: {
|
|
365
|
+
name: 'bondType';
|
|
377
366
|
};
|
|
378
367
|
};
|
|
379
368
|
},
|
|
380
369
|
{
|
|
381
|
-
|
|
382
|
-
|
|
370
|
+
name: 'bondName';
|
|
371
|
+
type: 'string';
|
|
383
372
|
}
|
|
384
373
|
];
|
|
385
374
|
},
|
|
386
375
|
{
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
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.'
|
|
398
387
|
];
|
|
399
|
-
|
|
388
|
+
discriminator: [
|
|
400
389
|
212,
|
|
401
390
|
162,
|
|
402
391
|
53,
|
|
@@ -406,18 +395,18 @@ type Jbond = {
|
|
|
406
395
|
61,
|
|
407
396
|
166
|
|
408
397
|
];
|
|
409
|
-
|
|
398
|
+
accounts: [
|
|
410
399
|
{
|
|
411
|
-
|
|
400
|
+
name: 'bondState';
|
|
412
401
|
},
|
|
413
402
|
{
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
403
|
+
name: 'validatorBond';
|
|
404
|
+
writable: true;
|
|
405
|
+
pda: {
|
|
406
|
+
seeds: [
|
|
418
407
|
{
|
|
419
|
-
|
|
420
|
-
|
|
408
|
+
kind: 'const';
|
|
409
|
+
value: [
|
|
421
410
|
118,
|
|
422
411
|
97,
|
|
423
412
|
108,
|
|
@@ -435,42 +424,42 @@ type Jbond = {
|
|
|
435
424
|
];
|
|
436
425
|
},
|
|
437
426
|
{
|
|
438
|
-
|
|
439
|
-
|
|
427
|
+
kind: 'account';
|
|
428
|
+
path: 'bondState';
|
|
440
429
|
},
|
|
441
430
|
{
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
431
|
+
kind: 'account';
|
|
432
|
+
path: 'validator_bond.vote_account';
|
|
433
|
+
account: 'validatorBond';
|
|
445
434
|
}
|
|
446
435
|
];
|
|
447
436
|
};
|
|
448
437
|
},
|
|
449
438
|
{
|
|
450
|
-
|
|
451
|
-
|
|
439
|
+
name: 'identity';
|
|
440
|
+
signer: true;
|
|
452
441
|
},
|
|
453
442
|
{
|
|
454
|
-
|
|
455
|
-
|
|
443
|
+
name: 'newWithdrawAuthority';
|
|
444
|
+
optional: true;
|
|
456
445
|
}
|
|
457
446
|
];
|
|
458
|
-
|
|
447
|
+
args: [];
|
|
459
448
|
},
|
|
460
449
|
{
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
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.'
|
|
472
461
|
];
|
|
473
|
-
|
|
462
|
+
discriminator: [
|
|
474
463
|
132,
|
|
475
464
|
225,
|
|
476
465
|
254,
|
|
@@ -480,19 +469,19 @@ type Jbond = {
|
|
|
480
469
|
176,
|
|
481
470
|
66
|
|
482
471
|
];
|
|
483
|
-
|
|
472
|
+
accounts: [
|
|
484
473
|
{
|
|
485
|
-
|
|
486
|
-
|
|
474
|
+
name: 'bondState';
|
|
475
|
+
writable: true;
|
|
487
476
|
},
|
|
488
477
|
{
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
478
|
+
name: 'validatorBond';
|
|
479
|
+
writable: true;
|
|
480
|
+
pda: {
|
|
481
|
+
seeds: [
|
|
493
482
|
{
|
|
494
|
-
|
|
495
|
-
|
|
483
|
+
kind: 'const';
|
|
484
|
+
value: [
|
|
496
485
|
118,
|
|
497
486
|
97,
|
|
498
487
|
108,
|
|
@@ -510,73 +499,73 @@ type Jbond = {
|
|
|
510
499
|
];
|
|
511
500
|
},
|
|
512
501
|
{
|
|
513
|
-
|
|
514
|
-
|
|
502
|
+
kind: 'account';
|
|
503
|
+
path: 'bondState';
|
|
515
504
|
},
|
|
516
505
|
{
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
506
|
+
kind: 'account';
|
|
507
|
+
path: 'validator_bond.vote_account';
|
|
508
|
+
account: 'validatorBond';
|
|
520
509
|
}
|
|
521
510
|
];
|
|
522
511
|
};
|
|
523
512
|
},
|
|
524
513
|
{
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
514
|
+
name: 'payer';
|
|
515
|
+
writable: true;
|
|
516
|
+
signer: true;
|
|
528
517
|
},
|
|
529
518
|
{
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
519
|
+
name: 'payerTokenAccount';
|
|
520
|
+
writable: true;
|
|
521
|
+
optional: true;
|
|
533
522
|
},
|
|
534
523
|
{
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
524
|
+
name: 'bondTokenAccount';
|
|
525
|
+
writable: true;
|
|
526
|
+
optional: true;
|
|
538
527
|
},
|
|
539
528
|
{
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
529
|
+
name: 'stakeAccount';
|
|
530
|
+
writable: true;
|
|
531
|
+
optional: true;
|
|
543
532
|
},
|
|
544
533
|
{
|
|
545
|
-
|
|
546
|
-
|
|
534
|
+
name: 'systemProgram';
|
|
535
|
+
address: '11111111111111111111111111111111';
|
|
547
536
|
},
|
|
548
537
|
{
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
538
|
+
name: 'tokenProgram';
|
|
539
|
+
optional: true;
|
|
540
|
+
address: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
|
|
552
541
|
},
|
|
553
542
|
{
|
|
554
|
-
|
|
555
|
-
|
|
543
|
+
name: 'stakeProgram';
|
|
544
|
+
optional: true;
|
|
556
545
|
}
|
|
557
546
|
];
|
|
558
|
-
|
|
547
|
+
args: [
|
|
559
548
|
{
|
|
560
|
-
|
|
561
|
-
|
|
549
|
+
name: 'amount';
|
|
550
|
+
type: 'u64';
|
|
562
551
|
}
|
|
563
552
|
];
|
|
564
553
|
},
|
|
565
554
|
{
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
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.'
|
|
578
567
|
];
|
|
579
|
-
|
|
568
|
+
discriminator: [
|
|
580
569
|
99,
|
|
581
570
|
64,
|
|
582
571
|
127,
|
|
@@ -586,19 +575,19 @@ type Jbond = {
|
|
|
586
575
|
70,
|
|
587
576
|
204
|
|
588
577
|
];
|
|
589
|
-
|
|
578
|
+
accounts: [
|
|
590
579
|
{
|
|
591
|
-
|
|
592
|
-
|
|
580
|
+
name: 'bondState';
|
|
581
|
+
writable: true;
|
|
593
582
|
},
|
|
594
583
|
{
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
584
|
+
name: 'validatorBond';
|
|
585
|
+
writable: true;
|
|
586
|
+
pda: {
|
|
587
|
+
seeds: [
|
|
599
588
|
{
|
|
600
|
-
|
|
601
|
-
|
|
589
|
+
kind: 'const';
|
|
590
|
+
value: [
|
|
602
591
|
118,
|
|
603
592
|
97,
|
|
604
593
|
108,
|
|
@@ -616,65 +605,65 @@ type Jbond = {
|
|
|
616
605
|
];
|
|
617
606
|
},
|
|
618
607
|
{
|
|
619
|
-
|
|
620
|
-
|
|
608
|
+
kind: 'account';
|
|
609
|
+
path: 'bondState';
|
|
621
610
|
},
|
|
622
611
|
{
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
612
|
+
kind: 'account';
|
|
613
|
+
path: 'validator_bond.vote_account';
|
|
614
|
+
account: 'validatorBond';
|
|
626
615
|
}
|
|
627
616
|
];
|
|
628
617
|
};
|
|
629
618
|
},
|
|
630
619
|
{
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
620
|
+
name: 'withdrawalAuthority';
|
|
621
|
+
writable: true;
|
|
622
|
+
signer: true;
|
|
634
623
|
},
|
|
635
624
|
{
|
|
636
|
-
|
|
637
|
-
|
|
625
|
+
name: 'destination';
|
|
626
|
+
writable: true;
|
|
638
627
|
},
|
|
639
628
|
{
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
629
|
+
name: 'destinationTokenAccount';
|
|
630
|
+
writable: true;
|
|
631
|
+
optional: true;
|
|
643
632
|
},
|
|
644
633
|
{
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
634
|
+
name: 'bondTokenAccount';
|
|
635
|
+
writable: true;
|
|
636
|
+
optional: true;
|
|
648
637
|
},
|
|
649
638
|
{
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
639
|
+
name: 'stakeAccount';
|
|
640
|
+
writable: true;
|
|
641
|
+
optional: true;
|
|
653
642
|
},
|
|
654
643
|
{
|
|
655
|
-
|
|
656
|
-
|
|
644
|
+
name: 'systemProgram';
|
|
645
|
+
address: '11111111111111111111111111111111';
|
|
657
646
|
},
|
|
658
647
|
{
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
648
|
+
name: 'tokenProgram';
|
|
649
|
+
optional: true;
|
|
650
|
+
address: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';
|
|
662
651
|
},
|
|
663
652
|
{
|
|
664
|
-
|
|
665
|
-
|
|
653
|
+
name: 'stakeProgram';
|
|
654
|
+
optional: true;
|
|
666
655
|
}
|
|
667
656
|
];
|
|
668
|
-
|
|
657
|
+
args: [
|
|
669
658
|
{
|
|
670
|
-
|
|
671
|
-
|
|
659
|
+
name: 'amount';
|
|
660
|
+
type: 'u64';
|
|
672
661
|
}
|
|
673
662
|
];
|
|
674
663
|
},
|
|
675
664
|
{
|
|
676
|
-
|
|
677
|
-
|
|
665
|
+
name: 'globalConfigure';
|
|
666
|
+
discriminator: [
|
|
678
667
|
67,
|
|
679
668
|
142,
|
|
680
669
|
164,
|
|
@@ -684,15 +673,15 @@ type Jbond = {
|
|
|
684
673
|
144,
|
|
685
674
|
187
|
|
686
675
|
];
|
|
687
|
-
|
|
676
|
+
accounts: [
|
|
688
677
|
{
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
678
|
+
name: 'globalState';
|
|
679
|
+
writable: true;
|
|
680
|
+
pda: {
|
|
681
|
+
seeds: [
|
|
693
682
|
{
|
|
694
|
-
|
|
695
|
-
|
|
683
|
+
kind: 'const';
|
|
684
|
+
value: [
|
|
696
685
|
103,
|
|
697
686
|
108,
|
|
698
687
|
111,
|
|
@@ -711,27 +700,27 @@ type Jbond = {
|
|
|
711
700
|
};
|
|
712
701
|
},
|
|
713
702
|
{
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
703
|
+
name: 'authority';
|
|
704
|
+
signer: true;
|
|
705
|
+
relations: [
|
|
706
|
+
'globalState'
|
|
718
707
|
];
|
|
719
708
|
}
|
|
720
709
|
];
|
|
721
|
-
|
|
710
|
+
args: [
|
|
722
711
|
{
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
712
|
+
name: 'data';
|
|
713
|
+
type: {
|
|
714
|
+
defined: {
|
|
715
|
+
name: 'globalConfigureData';
|
|
727
716
|
};
|
|
728
717
|
};
|
|
729
718
|
}
|
|
730
719
|
];
|
|
731
720
|
},
|
|
732
721
|
{
|
|
733
|
-
|
|
734
|
-
|
|
722
|
+
name: 'globalInitialize';
|
|
723
|
+
discriminator: [
|
|
735
724
|
30,
|
|
736
725
|
79,
|
|
737
726
|
193,
|
|
@@ -741,15 +730,15 @@ type Jbond = {
|
|
|
741
730
|
223,
|
|
742
731
|
196
|
|
743
732
|
];
|
|
744
|
-
|
|
733
|
+
accounts: [
|
|
745
734
|
{
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
735
|
+
name: 'globalState';
|
|
736
|
+
writable: true;
|
|
737
|
+
pda: {
|
|
738
|
+
seeds: [
|
|
750
739
|
{
|
|
751
|
-
|
|
752
|
-
|
|
740
|
+
kind: 'const';
|
|
741
|
+
value: [
|
|
753
742
|
103,
|
|
754
743
|
108,
|
|
755
744
|
111,
|
|
@@ -768,23 +757,23 @@ type Jbond = {
|
|
|
768
757
|
};
|
|
769
758
|
},
|
|
770
759
|
{
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
760
|
+
name: 'authority';
|
|
761
|
+
writable: true;
|
|
762
|
+
signer: true;
|
|
774
763
|
},
|
|
775
764
|
{
|
|
776
|
-
|
|
777
|
-
|
|
765
|
+
name: 'systemProgram';
|
|
766
|
+
address: '11111111111111111111111111111111';
|
|
778
767
|
}
|
|
779
768
|
];
|
|
780
|
-
|
|
769
|
+
args: [];
|
|
781
770
|
},
|
|
782
771
|
{
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
772
|
+
name: 'migrateBond';
|
|
773
|
+
docs: [
|
|
774
|
+
'Migrates validator bond data from legacy structure to new structure.'
|
|
786
775
|
];
|
|
787
|
-
|
|
776
|
+
discriminator: [
|
|
788
777
|
107,
|
|
789
778
|
119,
|
|
790
779
|
59,
|
|
@@ -794,26 +783,26 @@ type Jbond = {
|
|
|
794
783
|
37,
|
|
795
784
|
163
|
|
796
785
|
];
|
|
797
|
-
|
|
786
|
+
accounts: [
|
|
798
787
|
{
|
|
799
|
-
|
|
800
|
-
|
|
788
|
+
name: 'bondState';
|
|
789
|
+
writable: true;
|
|
801
790
|
},
|
|
802
791
|
{
|
|
803
|
-
|
|
804
|
-
|
|
792
|
+
name: 'legacyValidatorBond';
|
|
793
|
+
writable: true;
|
|
805
794
|
},
|
|
806
795
|
{
|
|
807
|
-
|
|
796
|
+
name: 'legacyVoteAccount';
|
|
808
797
|
},
|
|
809
798
|
{
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
799
|
+
name: 'validatorBond';
|
|
800
|
+
writable: true;
|
|
801
|
+
pda: {
|
|
802
|
+
seeds: [
|
|
814
803
|
{
|
|
815
|
-
|
|
816
|
-
|
|
804
|
+
kind: 'const';
|
|
805
|
+
value: [
|
|
817
806
|
118,
|
|
818
807
|
97,
|
|
819
808
|
108,
|
|
@@ -831,34 +820,34 @@ type Jbond = {
|
|
|
831
820
|
];
|
|
832
821
|
},
|
|
833
822
|
{
|
|
834
|
-
|
|
835
|
-
|
|
823
|
+
kind: 'account';
|
|
824
|
+
path: 'bondState';
|
|
836
825
|
},
|
|
837
826
|
{
|
|
838
|
-
|
|
839
|
-
|
|
827
|
+
kind: 'account';
|
|
828
|
+
path: 'legacyVoteAccount';
|
|
840
829
|
}
|
|
841
830
|
];
|
|
842
831
|
};
|
|
843
832
|
},
|
|
844
833
|
{
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
834
|
+
name: 'creator';
|
|
835
|
+
writable: true;
|
|
836
|
+
signer: true;
|
|
848
837
|
},
|
|
849
838
|
{
|
|
850
|
-
|
|
851
|
-
|
|
839
|
+
name: 'systemProgram';
|
|
840
|
+
address: '11111111111111111111111111111111';
|
|
852
841
|
}
|
|
853
842
|
];
|
|
854
|
-
|
|
843
|
+
args: [];
|
|
855
844
|
},
|
|
856
845
|
{
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
846
|
+
name: 'sessionFinish';
|
|
847
|
+
docs: [
|
|
848
|
+
'Finishes a bond, preventing further deposits and withdrawals.'
|
|
860
849
|
];
|
|
861
|
-
|
|
850
|
+
discriminator: [
|
|
862
851
|
230,
|
|
863
852
|
209,
|
|
864
853
|
54,
|
|
@@ -868,28 +857,28 @@ type Jbond = {
|
|
|
868
857
|
137,
|
|
869
858
|
113
|
|
870
859
|
];
|
|
871
|
-
|
|
860
|
+
accounts: [
|
|
872
861
|
{
|
|
873
|
-
|
|
874
|
-
|
|
862
|
+
name: 'bondState';
|
|
863
|
+
writable: true;
|
|
875
864
|
},
|
|
876
865
|
{
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
866
|
+
name: 'authority';
|
|
867
|
+
writable: true;
|
|
868
|
+
signer: true;
|
|
869
|
+
relations: [
|
|
870
|
+
'bondState'
|
|
882
871
|
];
|
|
883
872
|
}
|
|
884
873
|
];
|
|
885
|
-
|
|
874
|
+
args: [];
|
|
886
875
|
},
|
|
887
876
|
{
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
877
|
+
name: 'sessionStart';
|
|
878
|
+
docs: [
|
|
879
|
+
'Starts a paused bond, allowing deposits and withdrawals to resume.'
|
|
891
880
|
];
|
|
892
|
-
|
|
881
|
+
discriminator: [
|
|
893
882
|
132,
|
|
894
883
|
93,
|
|
895
884
|
83,
|
|
@@ -899,32 +888,32 @@ type Jbond = {
|
|
|
899
888
|
58,
|
|
900
889
|
92
|
|
901
890
|
];
|
|
902
|
-
|
|
891
|
+
accounts: [
|
|
903
892
|
{
|
|
904
|
-
|
|
905
|
-
|
|
893
|
+
name: 'bondState';
|
|
894
|
+
writable: true;
|
|
906
895
|
},
|
|
907
896
|
{
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
897
|
+
name: 'authority';
|
|
898
|
+
writable: true;
|
|
899
|
+
signer: true;
|
|
900
|
+
relations: [
|
|
901
|
+
'bondState'
|
|
913
902
|
];
|
|
914
903
|
}
|
|
915
904
|
];
|
|
916
|
-
|
|
905
|
+
args: [
|
|
917
906
|
{
|
|
918
|
-
|
|
919
|
-
|
|
907
|
+
name: 'durationSecs';
|
|
908
|
+
type: 'u64';
|
|
920
909
|
}
|
|
921
910
|
];
|
|
922
911
|
}
|
|
923
912
|
];
|
|
924
|
-
|
|
913
|
+
accounts: [
|
|
925
914
|
{
|
|
926
|
-
|
|
927
|
-
|
|
915
|
+
name: 'bondState';
|
|
916
|
+
discriminator: [
|
|
928
917
|
251,
|
|
929
918
|
95,
|
|
930
919
|
76,
|
|
@@ -936,8 +925,8 @@ type Jbond = {
|
|
|
936
925
|
];
|
|
937
926
|
},
|
|
938
927
|
{
|
|
939
|
-
|
|
940
|
-
|
|
928
|
+
name: 'globalState';
|
|
929
|
+
discriminator: [
|
|
941
930
|
163,
|
|
942
931
|
46,
|
|
943
932
|
74,
|
|
@@ -949,8 +938,8 @@ type Jbond = {
|
|
|
949
938
|
];
|
|
950
939
|
},
|
|
951
940
|
{
|
|
952
|
-
|
|
953
|
-
|
|
941
|
+
name: 'validatorBond';
|
|
942
|
+
discriminator: [
|
|
954
943
|
82,
|
|
955
944
|
127,
|
|
956
945
|
243,
|
|
@@ -962,10 +951,10 @@ type Jbond = {
|
|
|
962
951
|
];
|
|
963
952
|
}
|
|
964
953
|
];
|
|
965
|
-
|
|
954
|
+
events: [
|
|
966
955
|
{
|
|
967
|
-
|
|
968
|
-
|
|
956
|
+
name: 'bondFinished';
|
|
957
|
+
discriminator: [
|
|
969
958
|
223,
|
|
970
959
|
254,
|
|
971
960
|
3,
|
|
@@ -977,8 +966,8 @@ type Jbond = {
|
|
|
977
966
|
];
|
|
978
967
|
},
|
|
979
968
|
{
|
|
980
|
-
|
|
981
|
-
|
|
969
|
+
name: 'bondStarted';
|
|
970
|
+
discriminator: [
|
|
982
971
|
235,
|
|
983
972
|
69,
|
|
984
973
|
80,
|
|
@@ -990,8 +979,8 @@ type Jbond = {
|
|
|
990
979
|
];
|
|
991
980
|
},
|
|
992
981
|
{
|
|
993
|
-
|
|
994
|
-
|
|
982
|
+
name: 'collateralToppedUp';
|
|
983
|
+
discriminator: [
|
|
995
984
|
189,
|
|
996
985
|
137,
|
|
997
986
|
204,
|
|
@@ -1003,8 +992,8 @@ type Jbond = {
|
|
|
1003
992
|
];
|
|
1004
993
|
},
|
|
1005
994
|
{
|
|
1006
|
-
|
|
1007
|
-
|
|
995
|
+
name: 'collateralWithdrawn';
|
|
996
|
+
discriminator: [
|
|
1008
997
|
51,
|
|
1009
998
|
224,
|
|
1010
999
|
133,
|
|
@@ -1016,8 +1005,8 @@ type Jbond = {
|
|
|
1016
1005
|
];
|
|
1017
1006
|
},
|
|
1018
1007
|
{
|
|
1019
|
-
|
|
1020
|
-
|
|
1008
|
+
name: 'compensationClaimed';
|
|
1009
|
+
discriminator: [
|
|
1021
1010
|
36,
|
|
1022
1011
|
159,
|
|
1023
1012
|
41,
|
|
@@ -1029,8 +1018,8 @@ type Jbond = {
|
|
|
1029
1018
|
];
|
|
1030
1019
|
},
|
|
1031
1020
|
{
|
|
1032
|
-
|
|
1033
|
-
|
|
1021
|
+
name: 'validatorRegistered';
|
|
1022
|
+
discriminator: [
|
|
1034
1023
|
20,
|
|
1035
1024
|
20,
|
|
1036
1025
|
190,
|
|
@@ -1042,208 +1031,208 @@ type Jbond = {
|
|
|
1042
1031
|
];
|
|
1043
1032
|
}
|
|
1044
1033
|
];
|
|
1045
|
-
|
|
1034
|
+
errors: [
|
|
1046
1035
|
{
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1036
|
+
code: 6000;
|
|
1037
|
+
name: 'invalidVoteAccount';
|
|
1038
|
+
msg: 'Invalid vote account';
|
|
1050
1039
|
},
|
|
1051
1040
|
{
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1041
|
+
code: 6001;
|
|
1042
|
+
name: 'identityMismatch';
|
|
1043
|
+
msg: 'Identity does not match vote account';
|
|
1055
1044
|
},
|
|
1056
1045
|
{
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1046
|
+
code: 6002;
|
|
1047
|
+
name: 'insufficientCollateral';
|
|
1048
|
+
msg: 'Insufficient collateral amount';
|
|
1060
1049
|
},
|
|
1061
1050
|
{
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1051
|
+
code: 6003;
|
|
1052
|
+
name: 'targetAprTooLow';
|
|
1053
|
+
msg: 'Target APR is below minimum threshold';
|
|
1065
1054
|
},
|
|
1066
1055
|
{
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1056
|
+
code: 6004;
|
|
1057
|
+
name: 'mathOverflow';
|
|
1058
|
+
msg: 'Math overflow';
|
|
1070
1059
|
},
|
|
1071
1060
|
{
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1061
|
+
code: 6005;
|
|
1062
|
+
name: 'invalidAmount';
|
|
1063
|
+
msg: 'Invalid amount';
|
|
1075
1064
|
},
|
|
1076
1065
|
{
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1066
|
+
code: 6006;
|
|
1067
|
+
name: 'validatorNotActive';
|
|
1068
|
+
msg: 'Validator bond account is not active';
|
|
1080
1069
|
},
|
|
1081
1070
|
{
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1071
|
+
code: 6007;
|
|
1072
|
+
name: 'validatorAlreadyRegistered';
|
|
1073
|
+
msg: 'Validator already registered';
|
|
1085
1074
|
},
|
|
1086
1075
|
{
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1076
|
+
code: 6008;
|
|
1077
|
+
name: 'unauthorized';
|
|
1078
|
+
msg: 'unauthorized';
|
|
1090
1079
|
},
|
|
1091
1080
|
{
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1081
|
+
code: 6009;
|
|
1082
|
+
name: 'withdrawalLockedNearEpochEnd';
|
|
1083
|
+
msg: 'Withdrawals are locked near the end of the epoch.';
|
|
1095
1084
|
},
|
|
1096
1085
|
{
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1086
|
+
code: 6010;
|
|
1087
|
+
name: 'missingTokenAccounts';
|
|
1088
|
+
msg: 'Missing token accounts for token collateral type';
|
|
1100
1089
|
},
|
|
1101
1090
|
{
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1091
|
+
code: 6011;
|
|
1092
|
+
name: 'missingTokenProgram';
|
|
1093
|
+
msg: 'Token program is required for token collateral type';
|
|
1105
1094
|
},
|
|
1106
1095
|
{
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1096
|
+
code: 6012;
|
|
1097
|
+
name: 'invalidMint';
|
|
1098
|
+
msg: 'Invalid mint for token collateral type';
|
|
1110
1099
|
},
|
|
1111
1100
|
{
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1101
|
+
code: 6013;
|
|
1102
|
+
name: 'missingStakeAccount';
|
|
1103
|
+
msg: 'Stake account is required for stake account collateral type';
|
|
1115
1104
|
},
|
|
1116
1105
|
{
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1106
|
+
code: 6014;
|
|
1107
|
+
name: 'missingStakeProgram';
|
|
1108
|
+
msg: 'Stake program is required for stake account collateral type';
|
|
1120
1109
|
},
|
|
1121
1110
|
{
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1111
|
+
code: 6015;
|
|
1112
|
+
name: 'bondFinished';
|
|
1113
|
+
msg: 'Bond is finished (deposits/withdrawals disabled)';
|
|
1125
1114
|
},
|
|
1126
1115
|
{
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1116
|
+
code: 6016;
|
|
1117
|
+
name: 'bondNotFinished';
|
|
1118
|
+
msg: 'Bond is not finished';
|
|
1130
1119
|
},
|
|
1131
1120
|
{
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1121
|
+
code: 6017;
|
|
1122
|
+
name: 'unsupportedCollateralType';
|
|
1123
|
+
msg: 'Unsupported collateral type';
|
|
1135
1124
|
},
|
|
1136
1125
|
{
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1126
|
+
code: 6018;
|
|
1127
|
+
name: 'overflow';
|
|
1128
|
+
msg: 'Math operation overflowed';
|
|
1140
1129
|
},
|
|
1141
1130
|
{
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1131
|
+
code: 6019;
|
|
1132
|
+
name: 'incorrectBondType';
|
|
1133
|
+
msg: 'Incorrect bond type for this operation';
|
|
1145
1134
|
},
|
|
1146
1135
|
{
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1136
|
+
code: 6020;
|
|
1137
|
+
name: 'bondNotFinishable';
|
|
1138
|
+
msg: 'This bond type can\'t be finished';
|
|
1150
1139
|
},
|
|
1151
1140
|
{
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1141
|
+
code: 6021;
|
|
1142
|
+
name: 'invalidArgument';
|
|
1143
|
+
msg: 'Invalid argument provided';
|
|
1155
1144
|
},
|
|
1156
1145
|
{
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1146
|
+
code: 6022;
|
|
1147
|
+
name: 'bondNotDisabled';
|
|
1148
|
+
msg: 'Bond is not disabled';
|
|
1160
1149
|
},
|
|
1161
1150
|
{
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1151
|
+
code: 6023;
|
|
1152
|
+
name: 'bondNotEnabled';
|
|
1153
|
+
msg: 'Bond is not enabled';
|
|
1165
1154
|
}
|
|
1166
1155
|
];
|
|
1167
|
-
|
|
1156
|
+
types: [
|
|
1168
1157
|
{
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1158
|
+
name: 'bondConfigureData';
|
|
1159
|
+
type: {
|
|
1160
|
+
kind: 'struct';
|
|
1161
|
+
fields: [
|
|
1173
1162
|
{
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1163
|
+
name: 'status';
|
|
1164
|
+
type: {
|
|
1165
|
+
option: {
|
|
1166
|
+
defined: {
|
|
1167
|
+
name: 'bondStatus';
|
|
1179
1168
|
};
|
|
1180
1169
|
};
|
|
1181
1170
|
};
|
|
1182
1171
|
},
|
|
1183
1172
|
{
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1173
|
+
name: 'newReserve';
|
|
1174
|
+
type: {
|
|
1175
|
+
option: 'pubkey';
|
|
1187
1176
|
};
|
|
1188
1177
|
},
|
|
1189
1178
|
{
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1179
|
+
name: 'newAuthority';
|
|
1180
|
+
type: {
|
|
1181
|
+
option: 'pubkey';
|
|
1193
1182
|
};
|
|
1194
1183
|
}
|
|
1195
1184
|
];
|
|
1196
1185
|
};
|
|
1197
1186
|
},
|
|
1198
1187
|
{
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1188
|
+
name: 'bondFinished';
|
|
1189
|
+
type: {
|
|
1190
|
+
kind: 'struct';
|
|
1191
|
+
fields: [
|
|
1203
1192
|
{
|
|
1204
|
-
|
|
1205
|
-
|
|
1193
|
+
name: 'bond';
|
|
1194
|
+
type: 'pubkey';
|
|
1206
1195
|
},
|
|
1207
1196
|
{
|
|
1208
|
-
|
|
1209
|
-
|
|
1197
|
+
name: 'authority';
|
|
1198
|
+
type: 'pubkey';
|
|
1210
1199
|
},
|
|
1211
1200
|
{
|
|
1212
|
-
|
|
1213
|
-
|
|
1201
|
+
name: 'timestamp';
|
|
1202
|
+
type: 'i64';
|
|
1214
1203
|
}
|
|
1215
1204
|
];
|
|
1216
1205
|
};
|
|
1217
1206
|
},
|
|
1218
1207
|
{
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1208
|
+
name: 'bondInitializeData';
|
|
1209
|
+
docs: [
|
|
1210
|
+
'Data required to initialize a performance bond'
|
|
1222
1211
|
];
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1212
|
+
type: {
|
|
1213
|
+
kind: 'struct';
|
|
1214
|
+
fields: [
|
|
1226
1215
|
{
|
|
1227
|
-
|
|
1228
|
-
|
|
1216
|
+
name: 'name';
|
|
1217
|
+
type: 'string';
|
|
1229
1218
|
},
|
|
1230
1219
|
{
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1220
|
+
name: 'bondType';
|
|
1221
|
+
type: {
|
|
1222
|
+
defined: {
|
|
1223
|
+
name: 'bondType';
|
|
1235
1224
|
};
|
|
1236
1225
|
};
|
|
1237
1226
|
},
|
|
1238
1227
|
{
|
|
1239
|
-
|
|
1240
|
-
|
|
1228
|
+
name: 'reserve';
|
|
1229
|
+
type: 'pubkey';
|
|
1241
1230
|
},
|
|
1242
1231
|
{
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1232
|
+
name: 'collateralType';
|
|
1233
|
+
type: {
|
|
1234
|
+
defined: {
|
|
1235
|
+
name: 'collateralType';
|
|
1247
1236
|
};
|
|
1248
1237
|
};
|
|
1249
1238
|
}
|
|
@@ -1251,359 +1240,359 @@ type Jbond = {
|
|
|
1251
1240
|
};
|
|
1252
1241
|
},
|
|
1253
1242
|
{
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1243
|
+
name: 'bondStarted';
|
|
1244
|
+
type: {
|
|
1245
|
+
kind: 'struct';
|
|
1246
|
+
fields: [
|
|
1258
1247
|
{
|
|
1259
|
-
|
|
1260
|
-
|
|
1248
|
+
name: 'bond';
|
|
1249
|
+
type: 'pubkey';
|
|
1261
1250
|
},
|
|
1262
1251
|
{
|
|
1263
|
-
|
|
1264
|
-
|
|
1252
|
+
name: 'authority';
|
|
1253
|
+
type: 'pubkey';
|
|
1265
1254
|
},
|
|
1266
1255
|
{
|
|
1267
|
-
|
|
1268
|
-
|
|
1256
|
+
name: 'timestamp';
|
|
1257
|
+
type: 'i64';
|
|
1269
1258
|
}
|
|
1270
1259
|
];
|
|
1271
1260
|
};
|
|
1272
1261
|
},
|
|
1273
1262
|
{
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1263
|
+
name: 'bondState';
|
|
1264
|
+
type: {
|
|
1265
|
+
kind: 'struct';
|
|
1266
|
+
fields: [
|
|
1278
1267
|
{
|
|
1279
|
-
|
|
1280
|
-
|
|
1268
|
+
name: 'name';
|
|
1269
|
+
type: 'string';
|
|
1281
1270
|
},
|
|
1282
1271
|
{
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1272
|
+
name: 'bondType';
|
|
1273
|
+
docs: [
|
|
1274
|
+
'The type of bond (e.g., Standard, Crowdfunding)'
|
|
1286
1275
|
];
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1276
|
+
type: {
|
|
1277
|
+
defined: {
|
|
1278
|
+
name: 'bondType';
|
|
1290
1279
|
};
|
|
1291
1280
|
};
|
|
1292
1281
|
},
|
|
1293
1282
|
{
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1283
|
+
name: 'collateralType';
|
|
1284
|
+
docs: [
|
|
1285
|
+
'The type of collateral accepted for this bond'
|
|
1297
1286
|
];
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1287
|
+
type: {
|
|
1288
|
+
defined: {
|
|
1289
|
+
name: 'collateralType';
|
|
1301
1290
|
};
|
|
1302
1291
|
};
|
|
1303
1292
|
},
|
|
1304
1293
|
{
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1294
|
+
name: 'reserve';
|
|
1295
|
+
docs: [
|
|
1296
|
+
'Reserve account where collateral is held'
|
|
1308
1297
|
];
|
|
1309
|
-
|
|
1298
|
+
type: 'pubkey';
|
|
1310
1299
|
},
|
|
1311
1300
|
{
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1301
|
+
name: 'authority';
|
|
1302
|
+
docs: [
|
|
1303
|
+
'Authority allowed to manage the bond configuration'
|
|
1315
1304
|
];
|
|
1316
|
-
|
|
1305
|
+
type: 'pubkey';
|
|
1317
1306
|
},
|
|
1318
1307
|
{
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1308
|
+
name: 'sessionId';
|
|
1309
|
+
docs: [
|
|
1310
|
+
'Unique identifier for the bonding session'
|
|
1322
1311
|
];
|
|
1323
|
-
|
|
1312
|
+
type: 'u32';
|
|
1324
1313
|
},
|
|
1325
1314
|
{
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1315
|
+
name: 'totalMembers';
|
|
1316
|
+
docs: [
|
|
1317
|
+
'Total number of users who have participated in the bond'
|
|
1329
1318
|
];
|
|
1330
|
-
|
|
1319
|
+
type: 'u16';
|
|
1331
1320
|
},
|
|
1332
1321
|
{
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1322
|
+
name: 'totalCompensationAmount';
|
|
1323
|
+
docs: [
|
|
1324
|
+
'Total compensation amount paid out'
|
|
1336
1325
|
];
|
|
1337
|
-
|
|
1326
|
+
type: 'u64';
|
|
1338
1327
|
},
|
|
1339
1328
|
{
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1329
|
+
name: 'sessionStartTs';
|
|
1330
|
+
docs: [
|
|
1331
|
+
'Start timestamp of the current session (unix seconds). 0 — not set.'
|
|
1343
1332
|
];
|
|
1344
|
-
|
|
1333
|
+
type: 'i64';
|
|
1345
1334
|
},
|
|
1346
1335
|
{
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1336
|
+
name: 'sessionFinishTs';
|
|
1337
|
+
docs: [
|
|
1338
|
+
'Finish timestamp of the current session (unix seconds). 0 — not set.'
|
|
1350
1339
|
];
|
|
1351
|
-
|
|
1340
|
+
type: 'i64';
|
|
1352
1341
|
},
|
|
1353
1342
|
{
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1343
|
+
name: 'status';
|
|
1344
|
+
docs: [
|
|
1345
|
+
'Current status of the bond'
|
|
1357
1346
|
];
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1347
|
+
type: {
|
|
1348
|
+
defined: {
|
|
1349
|
+
name: 'bondStatus';
|
|
1361
1350
|
};
|
|
1362
1351
|
};
|
|
1363
1352
|
},
|
|
1364
1353
|
{
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1354
|
+
name: 'bump';
|
|
1355
|
+
docs: [
|
|
1356
|
+
'Bump for the PDA'
|
|
1368
1357
|
];
|
|
1369
|
-
|
|
1358
|
+
type: 'u8';
|
|
1370
1359
|
}
|
|
1371
1360
|
];
|
|
1372
1361
|
};
|
|
1373
1362
|
},
|
|
1374
1363
|
{
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1364
|
+
name: 'bondStatus';
|
|
1365
|
+
type: {
|
|
1366
|
+
kind: 'enum';
|
|
1367
|
+
variants: [
|
|
1379
1368
|
{
|
|
1380
|
-
|
|
1369
|
+
name: 'active';
|
|
1381
1370
|
},
|
|
1382
1371
|
{
|
|
1383
|
-
|
|
1372
|
+
name: 'disabled';
|
|
1384
1373
|
}
|
|
1385
1374
|
];
|
|
1386
1375
|
};
|
|
1387
1376
|
},
|
|
1388
1377
|
{
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1378
|
+
name: 'bondType';
|
|
1379
|
+
docs: [
|
|
1380
|
+
'Types of bonds supported by the program'
|
|
1392
1381
|
];
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1382
|
+
type: {
|
|
1383
|
+
kind: 'enum';
|
|
1384
|
+
variants: [
|
|
1396
1385
|
{
|
|
1397
|
-
|
|
1386
|
+
name: 'standard';
|
|
1398
1387
|
},
|
|
1399
1388
|
{
|
|
1400
|
-
|
|
1389
|
+
name: 'crowdfunding';
|
|
1401
1390
|
}
|
|
1402
1391
|
];
|
|
1403
1392
|
};
|
|
1404
1393
|
},
|
|
1405
1394
|
{
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1395
|
+
name: 'collateralToppedUp';
|
|
1396
|
+
type: {
|
|
1397
|
+
kind: 'struct';
|
|
1398
|
+
fields: [
|
|
1410
1399
|
{
|
|
1411
|
-
|
|
1412
|
-
|
|
1400
|
+
name: 'validator';
|
|
1401
|
+
type: 'pubkey';
|
|
1413
1402
|
},
|
|
1414
1403
|
{
|
|
1415
|
-
|
|
1416
|
-
|
|
1404
|
+
name: 'amount';
|
|
1405
|
+
type: 'u64';
|
|
1417
1406
|
},
|
|
1418
1407
|
{
|
|
1419
|
-
|
|
1420
|
-
|
|
1408
|
+
name: 'postBalance';
|
|
1409
|
+
type: 'u64';
|
|
1421
1410
|
},
|
|
1422
1411
|
{
|
|
1423
|
-
|
|
1424
|
-
|
|
1412
|
+
name: 'timestamp';
|
|
1413
|
+
type: 'i64';
|
|
1425
1414
|
}
|
|
1426
1415
|
];
|
|
1427
1416
|
};
|
|
1428
1417
|
},
|
|
1429
1418
|
{
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1419
|
+
name: 'collateralType';
|
|
1420
|
+
docs: [
|
|
1421
|
+
'Types of collateral that can be used for bond deposit'
|
|
1433
1422
|
];
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1423
|
+
type: {
|
|
1424
|
+
kind: 'enum';
|
|
1425
|
+
variants: [
|
|
1437
1426
|
{
|
|
1438
|
-
|
|
1427
|
+
name: 'native';
|
|
1439
1428
|
},
|
|
1440
1429
|
{
|
|
1441
|
-
|
|
1430
|
+
name: 'stakeAccount';
|
|
1442
1431
|
},
|
|
1443
1432
|
{
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1433
|
+
name: 'token';
|
|
1434
|
+
fields: [
|
|
1435
|
+
'pubkey'
|
|
1447
1436
|
];
|
|
1448
1437
|
}
|
|
1449
1438
|
];
|
|
1450
1439
|
};
|
|
1451
1440
|
},
|
|
1452
1441
|
{
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1442
|
+
name: 'collateralWithdrawn';
|
|
1443
|
+
type: {
|
|
1444
|
+
kind: 'struct';
|
|
1445
|
+
fields: [
|
|
1457
1446
|
{
|
|
1458
|
-
|
|
1459
|
-
|
|
1447
|
+
name: 'validator';
|
|
1448
|
+
type: 'pubkey';
|
|
1460
1449
|
},
|
|
1461
1450
|
{
|
|
1462
|
-
|
|
1463
|
-
|
|
1451
|
+
name: 'amount';
|
|
1452
|
+
type: 'u64';
|
|
1464
1453
|
},
|
|
1465
1454
|
{
|
|
1466
|
-
|
|
1467
|
-
|
|
1455
|
+
name: 'postBalance';
|
|
1456
|
+
type: 'u64';
|
|
1468
1457
|
},
|
|
1469
1458
|
{
|
|
1470
|
-
|
|
1471
|
-
|
|
1459
|
+
name: 'timestamp';
|
|
1460
|
+
type: 'i64';
|
|
1472
1461
|
}
|
|
1473
1462
|
];
|
|
1474
1463
|
};
|
|
1475
1464
|
},
|
|
1476
1465
|
{
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1466
|
+
name: 'compensationClaimed';
|
|
1467
|
+
type: {
|
|
1468
|
+
kind: 'struct';
|
|
1469
|
+
fields: [
|
|
1481
1470
|
{
|
|
1482
|
-
|
|
1483
|
-
|
|
1471
|
+
name: 'validator';
|
|
1472
|
+
type: 'pubkey';
|
|
1484
1473
|
},
|
|
1485
1474
|
{
|
|
1486
|
-
|
|
1487
|
-
|
|
1475
|
+
name: 'amount';
|
|
1476
|
+
type: 'u64';
|
|
1488
1477
|
},
|
|
1489
1478
|
{
|
|
1490
|
-
|
|
1491
|
-
|
|
1479
|
+
name: 'postBalance';
|
|
1480
|
+
type: 'u64';
|
|
1492
1481
|
},
|
|
1493
1482
|
{
|
|
1494
|
-
|
|
1495
|
-
|
|
1483
|
+
name: 'epoch';
|
|
1484
|
+
type: 'u64';
|
|
1496
1485
|
},
|
|
1497
1486
|
{
|
|
1498
|
-
|
|
1499
|
-
|
|
1487
|
+
name: 'timestamp';
|
|
1488
|
+
type: 'i64';
|
|
1500
1489
|
}
|
|
1501
1490
|
];
|
|
1502
1491
|
};
|
|
1503
1492
|
},
|
|
1504
1493
|
{
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1494
|
+
name: 'globalConfigureData';
|
|
1495
|
+
type: {
|
|
1496
|
+
kind: 'struct';
|
|
1497
|
+
fields: [
|
|
1509
1498
|
{
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1499
|
+
name: 'newAuthority';
|
|
1500
|
+
type: {
|
|
1501
|
+
option: 'pubkey';
|
|
1513
1502
|
};
|
|
1514
1503
|
}
|
|
1515
1504
|
];
|
|
1516
1505
|
};
|
|
1517
1506
|
},
|
|
1518
1507
|
{
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1508
|
+
name: 'globalState';
|
|
1509
|
+
type: {
|
|
1510
|
+
kind: 'struct';
|
|
1511
|
+
fields: [
|
|
1523
1512
|
{
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1513
|
+
name: 'authority';
|
|
1514
|
+
docs: [
|
|
1515
|
+
'The authority allowed to manage the program'
|
|
1527
1516
|
];
|
|
1528
|
-
|
|
1517
|
+
type: 'pubkey';
|
|
1529
1518
|
},
|
|
1530
1519
|
{
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1520
|
+
name: 'bump';
|
|
1521
|
+
docs: [
|
|
1522
|
+
'Bump for the PDA'
|
|
1534
1523
|
];
|
|
1535
|
-
|
|
1524
|
+
type: 'u8';
|
|
1536
1525
|
}
|
|
1537
1526
|
];
|
|
1538
1527
|
};
|
|
1539
1528
|
},
|
|
1540
1529
|
{
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1530
|
+
name: 'validatorBond';
|
|
1531
|
+
type: {
|
|
1532
|
+
kind: 'struct';
|
|
1533
|
+
fields: [
|
|
1545
1534
|
{
|
|
1546
|
-
|
|
1547
|
-
|
|
1535
|
+
name: 'state';
|
|
1536
|
+
type: 'pubkey';
|
|
1548
1537
|
},
|
|
1549
1538
|
{
|
|
1550
|
-
|
|
1551
|
-
|
|
1539
|
+
name: 'identity';
|
|
1540
|
+
type: 'pubkey';
|
|
1552
1541
|
},
|
|
1553
1542
|
{
|
|
1554
|
-
|
|
1555
|
-
|
|
1543
|
+
name: 'voteAccount';
|
|
1544
|
+
type: 'pubkey';
|
|
1556
1545
|
},
|
|
1557
1546
|
{
|
|
1558
|
-
|
|
1559
|
-
|
|
1547
|
+
name: 'creator';
|
|
1548
|
+
type: 'pubkey';
|
|
1560
1549
|
},
|
|
1561
1550
|
{
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1551
|
+
name: 'withdrawalAuthority';
|
|
1552
|
+
type: {
|
|
1553
|
+
option: 'pubkey';
|
|
1565
1554
|
};
|
|
1566
1555
|
},
|
|
1567
1556
|
{
|
|
1568
|
-
|
|
1569
|
-
|
|
1557
|
+
name: 'createdAt';
|
|
1558
|
+
type: 'i64';
|
|
1570
1559
|
},
|
|
1571
1560
|
{
|
|
1572
|
-
|
|
1573
|
-
|
|
1561
|
+
name: 'bump';
|
|
1562
|
+
type: 'u8';
|
|
1574
1563
|
}
|
|
1575
1564
|
];
|
|
1576
1565
|
};
|
|
1577
1566
|
},
|
|
1578
1567
|
{
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1568
|
+
name: 'validatorRegistered';
|
|
1569
|
+
type: {
|
|
1570
|
+
kind: 'struct';
|
|
1571
|
+
fields: [
|
|
1583
1572
|
{
|
|
1584
|
-
|
|
1585
|
-
|
|
1573
|
+
name: 'identity';
|
|
1574
|
+
type: 'pubkey';
|
|
1586
1575
|
},
|
|
1587
1576
|
{
|
|
1588
|
-
|
|
1589
|
-
|
|
1577
|
+
name: 'voteAccount';
|
|
1578
|
+
type: 'pubkey';
|
|
1590
1579
|
},
|
|
1591
1580
|
{
|
|
1592
|
-
|
|
1593
|
-
|
|
1581
|
+
name: 'timestamp';
|
|
1582
|
+
type: 'i64';
|
|
1594
1583
|
}
|
|
1595
1584
|
];
|
|
1596
1585
|
};
|
|
1597
1586
|
}
|
|
1598
1587
|
];
|
|
1599
|
-
|
|
1588
|
+
constants: [
|
|
1600
1589
|
{
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1590
|
+
name: 'epochLockedSlotTail';
|
|
1591
|
+
docs: [
|
|
1592
|
+
'Epoch slot index at the end of an epoch after which withdrawals are locked'
|
|
1604
1593
|
];
|
|
1605
|
-
|
|
1606
|
-
|
|
1594
|
+
type: 'u64';
|
|
1595
|
+
value: '420000';
|
|
1607
1596
|
}
|
|
1608
1597
|
];
|
|
1609
1598
|
};
|
|
@@ -1611,25 +1600,25 @@ type Jbond = {
|
|
|
1611
1600
|
type GlobalState = IdlAccounts<Jbond>['globalState'];
|
|
1612
1601
|
type BondState = IdlAccounts<Jbond>['bondState'];
|
|
1613
1602
|
type ValidatorBond = IdlAccounts<Jbond>['validatorBond'];
|
|
1614
|
-
type BondType = IdlTypes<Jbond>['bondType'];
|
|
1615
1603
|
type CollateralType = IdlTypes<Jbond>['collateralType'];
|
|
1616
1604
|
type BondStateStatus = IdlTypes<Jbond>['bondStatus'];
|
|
1605
|
+
declare enum SessionStatus {
|
|
1606
|
+
Live = 0,
|
|
1607
|
+
Finished = 1
|
|
1608
|
+
}
|
|
1609
|
+
declare enum BondType {
|
|
1610
|
+
Standard = "standard",
|
|
1611
|
+
Crowdfunding = "crowdfunding"
|
|
1612
|
+
}
|
|
1613
|
+
declare enum BondTransactionType {
|
|
1614
|
+
Deposit = "deposit",
|
|
1615
|
+
Withdrawal = "withdrawal",
|
|
1616
|
+
Compensation = "compensation"
|
|
1617
|
+
}
|
|
1617
1618
|
type BondStateStats = {
|
|
1618
1619
|
totalCollected: number;
|
|
1619
1620
|
status: SessionStatus;
|
|
1620
1621
|
};
|
|
1621
|
-
declare const bondTypeToSeed: {
|
|
1622
|
-
standard: Seeds;
|
|
1623
|
-
crowdfunding: Seeds;
|
|
1624
|
-
};
|
|
1625
|
-
declare const BondTypeVariant: {
|
|
1626
|
-
Standard: BondType;
|
|
1627
|
-
Crowdfunding: BondType;
|
|
1628
|
-
};
|
|
1629
|
-
declare const BondStateStatusVariant: {
|
|
1630
|
-
Active: BondStateStatus;
|
|
1631
|
-
Disabled: BondStateStatus;
|
|
1632
|
-
};
|
|
1633
1622
|
type GlobalInitializeProps = {
|
|
1634
1623
|
authority?: PublicKey;
|
|
1635
1624
|
};
|
|
@@ -1646,19 +1635,22 @@ type RegisterValidatorProps = {
|
|
|
1646
1635
|
identity: PublicKey;
|
|
1647
1636
|
voteAccount: PublicKey;
|
|
1648
1637
|
creator?: PublicKey;
|
|
1638
|
+
collateralType?: CollateralType;
|
|
1649
1639
|
};
|
|
1650
1640
|
type TopUpCollateralProps = {
|
|
1651
1641
|
bondType: BondType;
|
|
1652
1642
|
name: string;
|
|
1653
1643
|
identity: PublicKey;
|
|
1654
1644
|
voteAccount: PublicKey;
|
|
1655
|
-
|
|
1645
|
+
amount: number;
|
|
1646
|
+
collateralType?: CollateralType;
|
|
1656
1647
|
payer?: PublicKey;
|
|
1657
1648
|
};
|
|
1658
1649
|
type WithdrawCollateralProps = {
|
|
1659
1650
|
bondType: BondType;
|
|
1660
1651
|
name: string;
|
|
1661
|
-
|
|
1652
|
+
amount: number;
|
|
1653
|
+
collateralType?: CollateralType;
|
|
1662
1654
|
voteAccount: PublicKey;
|
|
1663
1655
|
destination?: PublicKey;
|
|
1664
1656
|
withdrawalAuthority?: PublicKey;
|
|
@@ -1666,7 +1658,8 @@ type WithdrawCollateralProps = {
|
|
|
1666
1658
|
type ClaimProps = {
|
|
1667
1659
|
bondType: BondType;
|
|
1668
1660
|
name: string;
|
|
1669
|
-
|
|
1661
|
+
amount: number;
|
|
1662
|
+
collateralType?: CollateralType;
|
|
1670
1663
|
voteAccount: PublicKey;
|
|
1671
1664
|
reserve?: PublicKey;
|
|
1672
1665
|
authority?: PublicKey;
|
|
@@ -1687,7 +1680,7 @@ type BondConfigureProps = {
|
|
|
1687
1680
|
bondType: BondType;
|
|
1688
1681
|
name: string;
|
|
1689
1682
|
authority?: PublicKey;
|
|
1690
|
-
|
|
1683
|
+
status?: BondStateStatus;
|
|
1691
1684
|
newAuthority?: PublicKey;
|
|
1692
1685
|
newReserve?: PublicKey;
|
|
1693
1686
|
};
|
|
@@ -1716,34 +1709,31 @@ type TransactionHistoryItem = {
|
|
|
1716
1709
|
type: BondTransactionType;
|
|
1717
1710
|
amount: number;
|
|
1718
1711
|
};
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
}
|
|
1724
|
-
type
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
stakeAccount?: PublicKey;
|
|
1712
|
+
type BondStartProps = {
|
|
1713
|
+
bondType: BondType;
|
|
1714
|
+
name: string;
|
|
1715
|
+
duration: number;
|
|
1716
|
+
};
|
|
1717
|
+
type BondFinishProps = {
|
|
1718
|
+
bondType: BondType;
|
|
1719
|
+
name: string;
|
|
1728
1720
|
};
|
|
1729
|
-
declare enum SessionStatus {
|
|
1730
|
-
Live = 0,
|
|
1731
|
-
Finished = 1
|
|
1732
|
-
}
|
|
1733
1721
|
|
|
1734
1722
|
type GetHistoryOpts = {
|
|
1735
|
-
cluster?:
|
|
1723
|
+
cluster?: Cluster;
|
|
1736
1724
|
limit?: number;
|
|
1737
1725
|
before?: string;
|
|
1738
1726
|
until?: string;
|
|
1739
1727
|
};
|
|
1740
1728
|
declare class HistoryManager {
|
|
1741
|
-
|
|
1742
|
-
private connection;
|
|
1743
|
-
private readonly programId;
|
|
1729
|
+
readonly client: JBondClient;
|
|
1744
1730
|
private discCache;
|
|
1745
|
-
constructor(
|
|
1746
|
-
|
|
1731
|
+
constructor(client: JBondClient);
|
|
1732
|
+
get program(): _coral_xyz_anchor.Program<Jbond>;
|
|
1733
|
+
get programId(): any;
|
|
1734
|
+
get connection(): _solana_web3_js.Connection;
|
|
1735
|
+
debug(...args: any[]): void;
|
|
1736
|
+
getHistory(bondType: BondType, bondName: string, vote: PublicKeyInitData, opts?: GetHistoryOpts): Promise<TransactionHistoryItem[]>;
|
|
1747
1737
|
private fetchSignaturesForAddress;
|
|
1748
1738
|
private fetchParsedTransactions;
|
|
1749
1739
|
private getInstructionDiscriminator;
|
|
@@ -1782,8 +1772,8 @@ declare class JBondClient {
|
|
|
1782
1772
|
readonly provider: Provider;
|
|
1783
1773
|
readonly options: ClientOptions;
|
|
1784
1774
|
readonly program: Program<Jbond>;
|
|
1785
|
-
readonly history: HistoryManager;
|
|
1786
1775
|
constructor(provider: Provider, options?: ClientOptions);
|
|
1776
|
+
get history(): HistoryManager;
|
|
1787
1777
|
/**
|
|
1788
1778
|
* Creates an instance of `JBondClient` using a provided connection and wallet.
|
|
1789
1779
|
*/
|
|
@@ -1807,8 +1797,12 @@ declare class JBondClient {
|
|
|
1807
1797
|
/**
|
|
1808
1798
|
* Configure a specific option.
|
|
1809
1799
|
*/
|
|
1810
|
-
|
|
1811
|
-
|
|
1800
|
+
configure<K extends keyof ClientOptions>(key: K, val: ClientOptions[K]): this;
|
|
1801
|
+
/**
|
|
1802
|
+
* Debug logging
|
|
1803
|
+
* @param args
|
|
1804
|
+
*/
|
|
1805
|
+
debug(...args: any[]): void;
|
|
1812
1806
|
/**
|
|
1813
1807
|
* Program Derived Addresses (PDAs)
|
|
1814
1808
|
*/
|
|
@@ -1817,113 +1811,94 @@ declare class JBondClient {
|
|
|
1817
1811
|
bondState: (bondType: BondType, bondName: string) => [PublicKey, number];
|
|
1818
1812
|
validatorBond: (bondType: BondType, bondName: string, vote: PublicKeyInitData) => [PublicKey, number];
|
|
1819
1813
|
};
|
|
1814
|
+
/**
|
|
1815
|
+
* Initialize global state
|
|
1816
|
+
*/
|
|
1820
1817
|
globalInitialize(props: GlobalInitializeProps): Promise<string | undefined>;
|
|
1821
1818
|
/**
|
|
1822
1819
|
* Initialize the program
|
|
1823
|
-
* Default authority is the provider's wallet
|
|
1824
1820
|
*/
|
|
1825
1821
|
bondInitialize(props: BondInitializeProps): Promise<string | undefined>;
|
|
1826
1822
|
/**
|
|
1827
1823
|
* Register a new validator
|
|
1828
|
-
* Default creator is the provider's wallet
|
|
1829
1824
|
*/
|
|
1830
1825
|
registerValidator(props: RegisterValidatorProps): Promise<string | undefined>;
|
|
1831
1826
|
/**
|
|
1832
1827
|
* Top up collateral
|
|
1833
|
-
* Default payer is the provider's wallet
|
|
1834
1828
|
*/
|
|
1835
1829
|
topUpCollateral(props: TopUpCollateralProps): Promise<string | undefined>;
|
|
1836
1830
|
/**
|
|
1837
1831
|
* Withdraw collateral
|
|
1838
|
-
* Default withdrawal authority is the provider's wallet
|
|
1839
|
-
* Default destination is the provider's wallet
|
|
1840
|
-
* @return Transaction signature
|
|
1841
1832
|
*/
|
|
1842
1833
|
withdrawCollateral(props: WithdrawCollateralProps): Promise<string | undefined>;
|
|
1843
1834
|
/**
|
|
1844
1835
|
* Claim compensation
|
|
1845
|
-
* Default authority is the provider's wallet
|
|
1846
|
-
* @return Transaction signature
|
|
1847
1836
|
*/
|
|
1848
1837
|
claimCompensation(props: ClaimProps): Promise<string | undefined>;
|
|
1849
1838
|
/**
|
|
1850
1839
|
* Update global configuration for the program
|
|
1851
|
-
* Default authority is the provider's wallet
|
|
1852
|
-
* Only the current authority can call this
|
|
1853
|
-
* @return Transaction signature
|
|
1854
1840
|
*/
|
|
1855
1841
|
globalConfigure(props: GlobalConfigureProps): Promise<string | undefined>;
|
|
1856
1842
|
/**
|
|
1857
1843
|
* Update global configuration for the program
|
|
1858
|
-
* Default authority is the provider's wallet
|
|
1859
|
-
* Only the current authority can call this
|
|
1860
|
-
* @return Transaction signature
|
|
1861
1844
|
*/
|
|
1862
1845
|
bondConfigure(props: BondConfigureProps): Promise<string | undefined>;
|
|
1863
1846
|
/**
|
|
1864
1847
|
* Set withdrawal authority for validator bond
|
|
1865
|
-
* Only the validator identity can call this
|
|
1866
|
-
* Default identity is the provider's wallet
|
|
1867
|
-
* @return Transaction signature
|
|
1868
1848
|
*/
|
|
1869
1849
|
setWithdrawAuthority(props: SetWithdrawAuthorityProps): Promise<string | undefined>;
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1850
|
+
/**
|
|
1851
|
+
* Start crowdfunding bond session
|
|
1852
|
+
*/
|
|
1853
|
+
bondStart(props: BondStartProps): Promise<string | undefined>;
|
|
1854
|
+
/**
|
|
1855
|
+
* Finish crowdfunding bond session
|
|
1856
|
+
*/
|
|
1857
|
+
bondFinish(props: BondFinishProps): Promise<string | undefined>;
|
|
1858
|
+
/**
|
|
1859
|
+
* Build global state initialize instruction
|
|
1860
|
+
*/
|
|
1861
|
+
getGlobalInitializeIx(props: GlobalInitializeProps): Promise<TransactionInstruction>;
|
|
1880
1862
|
/**
|
|
1881
1863
|
* Build configure instruction
|
|
1882
1864
|
*/
|
|
1883
|
-
|
|
1865
|
+
getGlobalConfigureIx(props: GlobalConfigureProps): Promise<TransactionInstruction>;
|
|
1884
1866
|
/**
|
|
1885
|
-
* Build initialize instruction
|
|
1867
|
+
* Build bond initialize instruction
|
|
1886
1868
|
*/
|
|
1887
|
-
|
|
1888
|
-
buildConfigureIx(props: BondConfigureProps): Promise<TransactionInstruction>;
|
|
1889
|
-
buildRegisterIx(props: RegisterValidatorProps): Promise<TransactionInstruction>;
|
|
1890
|
-
buildTopUpIXs(props: TopUpCollateralProps): Promise<TransactionInstruction[]>;
|
|
1891
|
-
buildWithdrawIx(props: WithdrawCollateralProps): Promise<TransactionInstruction>;
|
|
1892
|
-
buildClaimIx(props: ClaimProps): Promise<TransactionInstruction>;
|
|
1893
|
-
buildSetWithdrawAuthorityIx(props: SetWithdrawAuthorityProps): Promise<TransactionInstruction>;
|
|
1894
|
-
buildBondFinishIx(props: {
|
|
1895
|
-
bondType: BondType;
|
|
1896
|
-
name: string;
|
|
1897
|
-
}): Promise<TransactionInstruction>;
|
|
1898
|
-
migrateBond(props: {
|
|
1899
|
-
bondType: BondType;
|
|
1900
|
-
name: string;
|
|
1901
|
-
voteAccount: PublicKeyInitData;
|
|
1902
|
-
}): Promise<string | undefined>;
|
|
1903
|
-
buildBondMigrateIx(props: {
|
|
1904
|
-
bondType: BondType;
|
|
1905
|
-
name: string;
|
|
1906
|
-
voteAccount: PublicKeyInitData;
|
|
1907
|
-
}): Promise<TransactionInstruction>;
|
|
1908
|
-
buildBondStartIx(props: {
|
|
1909
|
-
bondType: BondType;
|
|
1910
|
-
name: string;
|
|
1911
|
-
duration_secs: number;
|
|
1912
|
-
}): Promise<TransactionInstruction>;
|
|
1869
|
+
getBondInitializeIx(props: BondInitializeProps): Promise<TransactionInstruction>;
|
|
1913
1870
|
/**
|
|
1914
|
-
*
|
|
1871
|
+
* Build bond configure instruction
|
|
1915
1872
|
*/
|
|
1916
|
-
|
|
1873
|
+
getBondConfigureIx(props: BondConfigureProps): Promise<TransactionInstruction>;
|
|
1917
1874
|
/**
|
|
1918
|
-
*
|
|
1919
|
-
* @param bondType - Type of the bond
|
|
1920
|
-
* @param bondName - Name of the bond
|
|
1921
|
-
* @param withStats
|
|
1875
|
+
* Build register validator instruction
|
|
1922
1876
|
*/
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1877
|
+
getRegisterValidatorIx(props: RegisterValidatorProps): Promise<TransactionInstruction>;
|
|
1878
|
+
/**
|
|
1879
|
+
* Build top up collateral instructions
|
|
1880
|
+
*/
|
|
1881
|
+
getTopUpIxs(props: TopUpCollateralProps): Promise<TransactionInstruction[]>;
|
|
1882
|
+
/**
|
|
1883
|
+
* Build withdraw collateral instruction
|
|
1884
|
+
*/
|
|
1885
|
+
getWithdrawIx(props: WithdrawCollateralProps): Promise<TransactionInstruction>;
|
|
1886
|
+
/**
|
|
1887
|
+
* Build claim instruction
|
|
1888
|
+
*/
|
|
1889
|
+
getClaimIx(props: ClaimProps): Promise<TransactionInstruction>;
|
|
1890
|
+
/**
|
|
1891
|
+
* Build set withdraw authority instruction
|
|
1892
|
+
*/
|
|
1893
|
+
getSetWithdrawAuthorityIx(props: SetWithdrawAuthorityProps): Promise<TransactionInstruction>;
|
|
1894
|
+
/**
|
|
1895
|
+
* Build finish crowdfunding session instruction
|
|
1896
|
+
*/
|
|
1897
|
+
getBondSessionFinishIx(props: BondFinishProps): Promise<TransactionInstruction>;
|
|
1898
|
+
/**
|
|
1899
|
+
* Build start crowdfunding session instruction
|
|
1900
|
+
*/
|
|
1901
|
+
getBondSessionStartIx(props: BondStartProps): Promise<TransactionInstruction>;
|
|
1927
1902
|
/**
|
|
1928
1903
|
* Get all bond states with total collected collateral
|
|
1929
1904
|
*/
|
|
@@ -1977,68 +1952,114 @@ declare class JBondClient {
|
|
|
1977
1952
|
bump: number;
|
|
1978
1953
|
};
|
|
1979
1954
|
stateStats: {
|
|
1980
|
-
totalCollected:
|
|
1955
|
+
totalCollected: unknown;
|
|
1981
1956
|
status: SessionStatus;
|
|
1982
1957
|
};
|
|
1983
1958
|
}[]>;
|
|
1984
1959
|
/**
|
|
1985
|
-
*
|
|
1960
|
+
* Fetch global state or throw if not found
|
|
1986
1961
|
*/
|
|
1987
|
-
|
|
1962
|
+
getGlobalState(): Promise<{
|
|
1963
|
+
authority: PublicKey;
|
|
1964
|
+
bump: number;
|
|
1965
|
+
publicKey: PublicKey;
|
|
1966
|
+
}>;
|
|
1988
1967
|
/**
|
|
1989
|
-
*
|
|
1968
|
+
* Fetch bond state with stats
|
|
1990
1969
|
*/
|
|
1991
|
-
|
|
1970
|
+
getBondState(bondType: BondType, bondName: string): Promise<{
|
|
1971
|
+
name: string;
|
|
1972
|
+
bondType: ({
|
|
1973
|
+
crowdfunding?: undefined;
|
|
1974
|
+
} & {
|
|
1975
|
+
standard: Record<string, never>;
|
|
1976
|
+
}) | ({
|
|
1977
|
+
standard?: undefined;
|
|
1978
|
+
} & {
|
|
1979
|
+
crowdfunding: Record<string, never>;
|
|
1980
|
+
});
|
|
1981
|
+
collateralType: ({
|
|
1982
|
+
native?: undefined;
|
|
1983
|
+
token?: undefined;
|
|
1984
|
+
} & {
|
|
1985
|
+
stakeAccount: Record<string, never>;
|
|
1986
|
+
}) | ({
|
|
1987
|
+
stakeAccount?: undefined;
|
|
1988
|
+
token?: undefined;
|
|
1989
|
+
} & {
|
|
1990
|
+
native: Record<string, never>;
|
|
1991
|
+
}) | ({
|
|
1992
|
+
stakeAccount?: undefined;
|
|
1993
|
+
native?: undefined;
|
|
1994
|
+
} & {
|
|
1995
|
+
token: {
|
|
1996
|
+
0: PublicKey;
|
|
1997
|
+
};
|
|
1998
|
+
});
|
|
1999
|
+
reserve: PublicKey;
|
|
2000
|
+
authority: PublicKey;
|
|
2001
|
+
sessionId: number;
|
|
2002
|
+
totalMembers: number;
|
|
2003
|
+
totalCompensationAmount: bn_js;
|
|
2004
|
+
sessionStartTs: bn_js;
|
|
2005
|
+
sessionFinishTs: bn_js;
|
|
2006
|
+
status: ({
|
|
2007
|
+
disabled?: undefined;
|
|
2008
|
+
} & {
|
|
2009
|
+
active: Record<string, never>;
|
|
2010
|
+
}) | ({
|
|
2011
|
+
active?: undefined;
|
|
2012
|
+
} & {
|
|
2013
|
+
disabled: Record<string, never>;
|
|
2014
|
+
});
|
|
2015
|
+
bump: number;
|
|
2016
|
+
publicKey: PublicKey;
|
|
2017
|
+
}>;
|
|
1992
2018
|
/**
|
|
1993
2019
|
* Fetch validator bond data or null if not found
|
|
1994
2020
|
*/
|
|
1995
|
-
getValidatorBond(bondType: BondType, bondName: string, vote: PublicKeyInitData): Promise<
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2021
|
+
getValidatorBond(bondType: BondType, bondName: string, vote: PublicKeyInitData): Promise<{
|
|
2022
|
+
state: PublicKey;
|
|
2023
|
+
identity: PublicKey;
|
|
2024
|
+
voteAccount: PublicKey;
|
|
2025
|
+
creator: PublicKey;
|
|
2026
|
+
withdrawalAuthority: PublicKey | null;
|
|
2027
|
+
createdAt: bn_js;
|
|
2028
|
+
bump: number;
|
|
2029
|
+
publicKey: PublicKey;
|
|
2030
|
+
}>;
|
|
2000
2031
|
/**
|
|
2001
2032
|
* Get validator bond account balance (in SOL)
|
|
2002
|
-
* @param bondType - Type of the bond
|
|
2003
|
-
* @param bondName - Name of the bond
|
|
2004
|
-
* @param vote - Vote account public key
|
|
2005
|
-
* @return Balance in lamports
|
|
2006
2033
|
*/
|
|
2007
2034
|
getValidatorBondBalance(bondType: BondType, bondName: string, vote: PublicKeyInitData): Promise<number>;
|
|
2008
2035
|
/**
|
|
2009
2036
|
* Get total collected collateral for a bond state
|
|
2010
2037
|
*/
|
|
2011
|
-
getBondStateTotalCollected(bondType: BondType, bondName: string, votes: PublicKeyInitData[]): Promise<
|
|
2012
|
-
/**
|
|
2013
|
-
* Get transaction history for a specific validator bond account
|
|
2014
|
-
*/
|
|
2015
|
-
getHistory(bondType: BondType, bondName: string, vote: PublicKey, options?: {
|
|
2016
|
-
cluster?: 'mainnet-beta' | 'testnet' | 'devnet';
|
|
2017
|
-
limit?: number;
|
|
2018
|
-
before?: string;
|
|
2019
|
-
until?: string;
|
|
2020
|
-
}): Promise<TransactionHistoryItem[]>;
|
|
2021
|
-
/**
|
|
2022
|
-
* Get full transaction history by paginating through results
|
|
2023
|
-
* @param bondType
|
|
2024
|
-
* @param bondName
|
|
2025
|
-
* @param voteAccount
|
|
2026
|
-
* @param pageSize
|
|
2027
|
-
*/
|
|
2028
|
-
getFullHistory(bondType: BondType, bondName: string, voteAccount: PublicKey, pageSize?: number): Promise<TransactionHistoryItem[]>;
|
|
2029
|
-
/**
|
|
2030
|
-
* Get instruction discriminator from IDL
|
|
2031
|
-
* @param instructionName
|
|
2032
|
-
* @private
|
|
2033
|
-
*/
|
|
2034
|
-
private getInstructionDiscriminator;
|
|
2038
|
+
getBondStateTotalCollected(bondType: BondType, bondName: string, votes: PublicKeyInitData[]): Promise<unknown>;
|
|
2035
2039
|
/**
|
|
2036
2040
|
* Get bond state stats
|
|
2037
2041
|
* @param state
|
|
2038
2042
|
* @private
|
|
2039
2043
|
*/
|
|
2040
2044
|
private getBondStateStats;
|
|
2041
|
-
|
|
2045
|
+
/**
|
|
2046
|
+
* Get all validator bonds for a given bond state
|
|
2047
|
+
*/
|
|
2048
|
+
private getBondValidatorStates;
|
|
2049
|
+
/**
|
|
2050
|
+
* Get session status for bond state
|
|
2051
|
+
*/
|
|
2052
|
+
private getBondStateSessionStatus;
|
|
2042
2053
|
}
|
|
2043
2054
|
|
|
2044
|
-
|
|
2055
|
+
declare const GLOBAL_STATE_SEED = "global_state";
|
|
2056
|
+
declare const BOND_STATE_SEED = "bond_state";
|
|
2057
|
+
declare const VALIDATOR_BOND_SEED = "validator_bond";
|
|
2058
|
+
declare const STANDARD_BOND_SEED = "standard";
|
|
2059
|
+
declare const CROWDFUNDING_BOND_SEED = "crowdfunding";
|
|
2060
|
+
/**
|
|
2061
|
+
* Program IDs for different environments
|
|
2062
|
+
*/
|
|
2063
|
+
declare const ENV_PROGRAM_ID: Record<string, PublicKey>;
|
|
2064
|
+
|
|
2065
|
+
export { BOND_STATE_SEED, BondClientEnv, type BondConfigureProps, type BondFinishProps, type BondInitializeProps, type BondStartProps, type BondState, type BondStateStats, type BondStateStatus, BondTransactionType, BondType, CROWDFUNDING_BOND_SEED, type ClaimProps, type ClientOptions, type CollateralType, ENV_PROGRAM_ID, type EpochHistoryItem, GLOBAL_STATE_SEED, type GetHistoryGroupedProps, type GetHistoryProps, type GlobalConfigureProps, type GlobalInitializeProps, type GlobalState, JBondClient, type Jbond, NodeWallet, type RegisterValidatorProps, STANDARD_BOND_SEED, SessionStatus, type SetWithdrawAuthorityProps, type TopUpCollateralProps, type TransactionHistoryItem, VALIDATOR_BOND_SEED, type ValidatorBond, type WithdrawCollateralProps };
|