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