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