@jpool/bond-sdk 0.9.0-next.1 → 0.9.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +424 -416
- package/dist/index.d.ts +424 -416
- package/dist/index.js +28 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -19
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _solana_web3_js from '@solana/web3.js';
|
|
2
2
|
import { PublicKey, Transaction, VersionedTransaction, Keypair, Connection, PublicKeyInitData } from '@solana/web3.js';
|
|
3
|
-
import { BN,
|
|
3
|
+
import { BN, Provider, Program } from '@coral-xyz/anchor';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Program IDL in camelCase format in order to be used in JS/TS.
|
|
@@ -9,28 +9,28 @@ import { BN, AnchorProvider, Program } from '@coral-xyz/anchor';
|
|
|
9
9
|
* IDL can be found at `target/idl/jbond.json`.
|
|
10
10
|
*/
|
|
11
11
|
type Jbond = {
|
|
12
|
-
address:
|
|
13
|
-
metadata: {
|
|
14
|
-
name:
|
|
15
|
-
version:
|
|
16
|
-
spec:
|
|
17
|
-
description:
|
|
12
|
+
"address": "BondQ7KqZreTcW2UbeTNDcLCJQ3aXAtLn2Fm6ftaJDU";
|
|
13
|
+
"metadata": {
|
|
14
|
+
"name": "jbond";
|
|
15
|
+
"version": "0.2.1";
|
|
16
|
+
"spec": "0.1.0";
|
|
17
|
+
"description": "Jpool Bond Program";
|
|
18
18
|
};
|
|
19
|
-
instructions: [
|
|
19
|
+
"instructions": [
|
|
20
20
|
{
|
|
21
|
-
name:
|
|
22
|
-
docs: [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
"name": "claim";
|
|
22
|
+
"docs": [
|
|
23
|
+
"Claims compensation for a validator.",
|
|
24
|
+
"Transfers funds from the validator's bond account to reserve.",
|
|
25
|
+
"",
|
|
26
|
+
"# Arguments",
|
|
27
|
+
"* `amount` - Amount of compensation to claim (must be positive).",
|
|
28
|
+
"",
|
|
29
|
+
"# Errors",
|
|
30
|
+
"Fails if the authority is invalid, if the validator is not active,",
|
|
31
|
+
"if the amount is zero, or if there are insufficient funds."
|
|
32
32
|
];
|
|
33
|
-
discriminator: [
|
|
33
|
+
"discriminator": [
|
|
34
34
|
62,
|
|
35
35
|
198,
|
|
36
36
|
214,
|
|
@@ -40,15 +40,15 @@ type Jbond = {
|
|
|
40
40
|
108,
|
|
41
41
|
210
|
|
42
42
|
];
|
|
43
|
-
accounts: [
|
|
43
|
+
"accounts": [
|
|
44
44
|
{
|
|
45
|
-
name:
|
|
46
|
-
writable: true;
|
|
47
|
-
pda: {
|
|
48
|
-
seeds: [
|
|
45
|
+
"name": "globalState";
|
|
46
|
+
"writable": true;
|
|
47
|
+
"pda": {
|
|
48
|
+
"seeds": [
|
|
49
49
|
{
|
|
50
|
-
kind:
|
|
51
|
-
value: [
|
|
50
|
+
"kind": "const";
|
|
51
|
+
"value": [
|
|
52
52
|
103,
|
|
53
53
|
108,
|
|
54
54
|
111,
|
|
@@ -67,13 +67,13 @@ type Jbond = {
|
|
|
67
67
|
};
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
|
-
name:
|
|
71
|
-
writable: true;
|
|
72
|
-
pda: {
|
|
73
|
-
seeds: [
|
|
70
|
+
"name": "validatorBond";
|
|
71
|
+
"writable": true;
|
|
72
|
+
"pda": {
|
|
73
|
+
"seeds": [
|
|
74
74
|
{
|
|
75
|
-
kind:
|
|
76
|
-
value: [
|
|
75
|
+
"kind": "const";
|
|
76
|
+
"value": [
|
|
77
77
|
118,
|
|
78
78
|
97,
|
|
79
79
|
108,
|
|
@@ -91,49 +91,49 @@ type Jbond = {
|
|
|
91
91
|
];
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
|
-
kind:
|
|
95
|
-
path:
|
|
96
|
-
account:
|
|
94
|
+
"kind": "account";
|
|
95
|
+
"path": "validator_bond.vote_account";
|
|
96
|
+
"account": "validatorBond";
|
|
97
97
|
}
|
|
98
98
|
];
|
|
99
99
|
};
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
|
-
name:
|
|
103
|
-
writable: true;
|
|
102
|
+
"name": "reserve";
|
|
103
|
+
"writable": true;
|
|
104
104
|
},
|
|
105
105
|
{
|
|
106
|
-
name:
|
|
107
|
-
docs: [
|
|
108
|
-
|
|
106
|
+
"name": "authority";
|
|
107
|
+
"docs": [
|
|
108
|
+
"Authority that can trigger claims"
|
|
109
109
|
];
|
|
110
|
-
signer: true;
|
|
110
|
+
"signer": true;
|
|
111
111
|
},
|
|
112
112
|
{
|
|
113
|
-
name:
|
|
114
|
-
address:
|
|
113
|
+
"name": "systemProgram";
|
|
114
|
+
"address": "11111111111111111111111111111111";
|
|
115
115
|
}
|
|
116
116
|
];
|
|
117
|
-
args: [
|
|
117
|
+
"args": [
|
|
118
118
|
{
|
|
119
|
-
name:
|
|
120
|
-
type:
|
|
119
|
+
"name": "amount";
|
|
120
|
+
"type": "u64";
|
|
121
121
|
}
|
|
122
122
|
];
|
|
123
123
|
},
|
|
124
124
|
{
|
|
125
|
-
name:
|
|
126
|
-
docs: [
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
125
|
+
"name": "configure";
|
|
126
|
+
"docs": [
|
|
127
|
+
"Updates the global program configuration, including authority and reserve fields.",
|
|
128
|
+
"Allows changing the program's authority and updating the reserve account.",
|
|
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."
|
|
135
135
|
];
|
|
136
|
-
discriminator: [
|
|
136
|
+
"discriminator": [
|
|
137
137
|
245,
|
|
138
138
|
7,
|
|
139
139
|
108,
|
|
@@ -143,15 +143,15 @@ type Jbond = {
|
|
|
143
143
|
54,
|
|
144
144
|
217
|
|
145
145
|
];
|
|
146
|
-
accounts: [
|
|
146
|
+
"accounts": [
|
|
147
147
|
{
|
|
148
|
-
name:
|
|
149
|
-
writable: true;
|
|
150
|
-
pda: {
|
|
151
|
-
seeds: [
|
|
148
|
+
"name": "globalState";
|
|
149
|
+
"writable": true;
|
|
150
|
+
"pda": {
|
|
151
|
+
"seeds": [
|
|
152
152
|
{
|
|
153
|
-
kind:
|
|
154
|
-
value: [
|
|
153
|
+
"kind": "const";
|
|
154
|
+
"value": [
|
|
155
155
|
103,
|
|
156
156
|
108,
|
|
157
157
|
111,
|
|
@@ -170,35 +170,35 @@ type Jbond = {
|
|
|
170
170
|
};
|
|
171
171
|
},
|
|
172
172
|
{
|
|
173
|
-
name:
|
|
174
|
-
signer: true;
|
|
175
|
-
relations: [
|
|
176
|
-
|
|
173
|
+
"name": "authority";
|
|
174
|
+
"signer": true;
|
|
175
|
+
"relations": [
|
|
176
|
+
"globalState"
|
|
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": "configureData";
|
|
186
186
|
};
|
|
187
187
|
};
|
|
188
188
|
}
|
|
189
189
|
];
|
|
190
190
|
},
|
|
191
191
|
{
|
|
192
|
-
name:
|
|
193
|
-
docs: [
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
192
|
+
"name": "initialize";
|
|
193
|
+
"docs": [
|
|
194
|
+
"Initializes the global state for the bonding program.",
|
|
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
202
|
175,
|
|
203
203
|
175,
|
|
204
204
|
109,
|
|
@@ -208,15 +208,15 @@ type Jbond = {
|
|
|
208
208
|
155,
|
|
209
209
|
237
|
|
210
210
|
];
|
|
211
|
-
accounts: [
|
|
211
|
+
"accounts": [
|
|
212
212
|
{
|
|
213
|
-
name:
|
|
214
|
-
writable: true;
|
|
215
|
-
pda: {
|
|
216
|
-
seeds: [
|
|
213
|
+
"name": "globalState";
|
|
214
|
+
"writable": true;
|
|
215
|
+
"pda": {
|
|
216
|
+
"seeds": [
|
|
217
217
|
{
|
|
218
|
-
kind:
|
|
219
|
-
value: [
|
|
218
|
+
"kind": "const";
|
|
219
|
+
"value": [
|
|
220
220
|
103,
|
|
221
221
|
108,
|
|
222
222
|
111,
|
|
@@ -235,35 +235,35 @@ type Jbond = {
|
|
|
235
235
|
};
|
|
236
236
|
},
|
|
237
237
|
{
|
|
238
|
-
name:
|
|
239
|
-
writable: true;
|
|
240
|
-
signer: true;
|
|
238
|
+
"name": "authority";
|
|
239
|
+
"writable": true;
|
|
240
|
+
"signer": true;
|
|
241
241
|
},
|
|
242
242
|
{
|
|
243
|
-
name:
|
|
243
|
+
"name": "reserve";
|
|
244
244
|
},
|
|
245
245
|
{
|
|
246
|
-
name:
|
|
247
|
-
address:
|
|
246
|
+
"name": "systemProgram";
|
|
247
|
+
"address": "11111111111111111111111111111111";
|
|
248
248
|
}
|
|
249
249
|
];
|
|
250
|
-
args: [];
|
|
250
|
+
"args": [];
|
|
251
251
|
},
|
|
252
252
|
{
|
|
253
|
-
name:
|
|
254
|
-
docs: [
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
253
|
+
"name": "register";
|
|
254
|
+
"docs": [
|
|
255
|
+
"Registers a new validator with the bonding program.",
|
|
256
|
+
"Sets up the validator's bond account and deposits initial collateral.",
|
|
257
|
+
"",
|
|
258
|
+
"# Arguments",
|
|
259
|
+
"* `initial_collateral` - Amount of collateral to lock (must be positive).",
|
|
260
|
+
"* `withdrawal_authority` - Optional key that can withdraw collateral later.",
|
|
261
|
+
"",
|
|
262
|
+
"# Errors",
|
|
263
|
+
"Fails if the validator is already registered, if the vote account is invalid,",
|
|
264
|
+
"or if the initial collateral transfer fails."
|
|
265
265
|
];
|
|
266
|
-
discriminator: [
|
|
266
|
+
"discriminator": [
|
|
267
267
|
211,
|
|
268
268
|
124,
|
|
269
269
|
67,
|
|
@@ -273,15 +273,15 @@ type Jbond = {
|
|
|
273
273
|
178,
|
|
274
274
|
240
|
|
275
275
|
];
|
|
276
|
-
accounts: [
|
|
276
|
+
"accounts": [
|
|
277
277
|
{
|
|
278
|
-
name:
|
|
279
|
-
writable: true;
|
|
280
|
-
pda: {
|
|
281
|
-
seeds: [
|
|
278
|
+
"name": "globalState";
|
|
279
|
+
"writable": true;
|
|
280
|
+
"pda": {
|
|
281
|
+
"seeds": [
|
|
282
282
|
{
|
|
283
|
-
kind:
|
|
284
|
-
value: [
|
|
283
|
+
"kind": "const";
|
|
284
|
+
"value": [
|
|
285
285
|
103,
|
|
286
286
|
108,
|
|
287
287
|
111,
|
|
@@ -300,13 +300,13 @@ type Jbond = {
|
|
|
300
300
|
};
|
|
301
301
|
},
|
|
302
302
|
{
|
|
303
|
-
name:
|
|
304
|
-
writable: true;
|
|
305
|
-
pda: {
|
|
306
|
-
seeds: [
|
|
303
|
+
"name": "validatorBond";
|
|
304
|
+
"writable": true;
|
|
305
|
+
"pda": {
|
|
306
|
+
"seeds": [
|
|
307
307
|
{
|
|
308
|
-
kind:
|
|
309
|
-
value: [
|
|
308
|
+
"kind": "const";
|
|
309
|
+
"value": [
|
|
310
310
|
118,
|
|
311
311
|
97,
|
|
312
312
|
108,
|
|
@@ -324,52 +324,52 @@ type Jbond = {
|
|
|
324
324
|
];
|
|
325
325
|
},
|
|
326
326
|
{
|
|
327
|
-
kind:
|
|
328
|
-
path:
|
|
327
|
+
"kind": "account";
|
|
328
|
+
"path": "voteAccount";
|
|
329
329
|
}
|
|
330
330
|
];
|
|
331
331
|
};
|
|
332
332
|
},
|
|
333
333
|
{
|
|
334
|
-
name:
|
|
334
|
+
"name": "identity";
|
|
335
335
|
},
|
|
336
336
|
{
|
|
337
|
-
name:
|
|
337
|
+
"name": "voteAccount";
|
|
338
338
|
},
|
|
339
339
|
{
|
|
340
|
-
name:
|
|
341
|
-
docs: [
|
|
342
|
-
|
|
340
|
+
"name": "creator";
|
|
341
|
+
"docs": [
|
|
342
|
+
"The account creating the bond (pays for account creation and initial collateral)"
|
|
343
343
|
];
|
|
344
|
-
writable: true;
|
|
345
|
-
signer: true;
|
|
344
|
+
"writable": true;
|
|
345
|
+
"signer": true;
|
|
346
346
|
},
|
|
347
347
|
{
|
|
348
|
-
name:
|
|
349
|
-
address:
|
|
348
|
+
"name": "systemProgram";
|
|
349
|
+
"address": "11111111111111111111111111111111";
|
|
350
350
|
}
|
|
351
351
|
];
|
|
352
|
-
args: [
|
|
352
|
+
"args": [
|
|
353
353
|
{
|
|
354
|
-
name:
|
|
355
|
-
type:
|
|
354
|
+
"name": "initialCollateral";
|
|
355
|
+
"type": "u64";
|
|
356
356
|
}
|
|
357
357
|
];
|
|
358
358
|
},
|
|
359
359
|
{
|
|
360
|
-
name:
|
|
361
|
-
docs: [
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
360
|
+
"name": "setWithdrawAuthority";
|
|
361
|
+
"docs": [
|
|
362
|
+
"Sets a new withdrawal authority for a validator's bond account.",
|
|
363
|
+
"Allows changing who can withdraw collateral in the future.",
|
|
364
|
+
"",
|
|
365
|
+
"# Arguments",
|
|
366
|
+
"* `new_withdraw_authority` - Optional new withdrawal authority key (None to restrict to",
|
|
367
|
+
"identity).",
|
|
368
|
+
"",
|
|
369
|
+
"# Errors",
|
|
370
|
+
"Fails if the signer is not authorized to change the withdrawal authority."
|
|
371
371
|
];
|
|
372
|
-
discriminator: [
|
|
372
|
+
"discriminator": [
|
|
373
373
|
199,
|
|
374
374
|
146,
|
|
375
375
|
140,
|
|
@@ -379,15 +379,15 @@ type Jbond = {
|
|
|
379
379
|
8,
|
|
380
380
|
222
|
|
381
381
|
];
|
|
382
|
-
accounts: [
|
|
382
|
+
"accounts": [
|
|
383
383
|
{
|
|
384
|
-
name:
|
|
385
|
-
writable: true;
|
|
386
|
-
pda: {
|
|
387
|
-
seeds: [
|
|
384
|
+
"name": "validatorBond";
|
|
385
|
+
"writable": true;
|
|
386
|
+
"pda": {
|
|
387
|
+
"seeds": [
|
|
388
388
|
{
|
|
389
|
-
kind:
|
|
390
|
-
value: [
|
|
389
|
+
"kind": "const";
|
|
390
|
+
"value": [
|
|
391
391
|
118,
|
|
392
392
|
97,
|
|
393
393
|
108,
|
|
@@ -405,38 +405,38 @@ type Jbond = {
|
|
|
405
405
|
];
|
|
406
406
|
},
|
|
407
407
|
{
|
|
408
|
-
kind:
|
|
409
|
-
path:
|
|
410
|
-
account:
|
|
408
|
+
"kind": "account";
|
|
409
|
+
"path": "validator_bond.vote_account";
|
|
410
|
+
"account": "validatorBond";
|
|
411
411
|
}
|
|
412
412
|
];
|
|
413
413
|
};
|
|
414
414
|
},
|
|
415
415
|
{
|
|
416
|
-
name:
|
|
417
|
-
signer: true;
|
|
416
|
+
"name": "identity";
|
|
417
|
+
"signer": true;
|
|
418
418
|
},
|
|
419
419
|
{
|
|
420
|
-
name:
|
|
421
|
-
optional: true;
|
|
420
|
+
"name": "newWithdrawAuthority";
|
|
421
|
+
"optional": true;
|
|
422
422
|
}
|
|
423
423
|
];
|
|
424
|
-
args: [];
|
|
424
|
+
"args": [];
|
|
425
425
|
},
|
|
426
426
|
{
|
|
427
|
-
name:
|
|
428
|
-
docs: [
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
427
|
+
"name": "topUp";
|
|
428
|
+
"docs": [
|
|
429
|
+
"Adds additional collateral to an existing validator's bond.",
|
|
430
|
+
"Increases the collateral balance, enhancing the validator's stake.",
|
|
431
|
+
"",
|
|
432
|
+
"# Arguments",
|
|
433
|
+
"* `amount` - Amount to add.",
|
|
434
|
+
"",
|
|
435
|
+
"# Errors",
|
|
436
|
+
"Fails if the validator is not active, if the amount is zero,",
|
|
437
|
+
"or if the transfer of funds fails."
|
|
438
438
|
];
|
|
439
|
-
discriminator: [
|
|
439
|
+
"discriminator": [
|
|
440
440
|
236,
|
|
441
441
|
225,
|
|
442
442
|
96,
|
|
@@ -446,15 +446,15 @@ type Jbond = {
|
|
|
446
446
|
77,
|
|
447
447
|
208
|
|
448
448
|
];
|
|
449
|
-
accounts: [
|
|
449
|
+
"accounts": [
|
|
450
450
|
{
|
|
451
|
-
name:
|
|
452
|
-
writable: true;
|
|
453
|
-
pda: {
|
|
454
|
-
seeds: [
|
|
451
|
+
"name": "validatorBond";
|
|
452
|
+
"writable": true;
|
|
453
|
+
"pda": {
|
|
454
|
+
"seeds": [
|
|
455
455
|
{
|
|
456
|
-
kind:
|
|
457
|
-
value: [
|
|
456
|
+
"kind": "const";
|
|
457
|
+
"value": [
|
|
458
458
|
118,
|
|
459
459
|
97,
|
|
460
460
|
108,
|
|
@@ -472,45 +472,45 @@ type Jbond = {
|
|
|
472
472
|
];
|
|
473
473
|
},
|
|
474
474
|
{
|
|
475
|
-
kind:
|
|
476
|
-
path:
|
|
477
|
-
account:
|
|
475
|
+
"kind": "account";
|
|
476
|
+
"path": "validator_bond.vote_account";
|
|
477
|
+
"account": "validatorBond";
|
|
478
478
|
}
|
|
479
479
|
];
|
|
480
480
|
};
|
|
481
481
|
},
|
|
482
482
|
{
|
|
483
|
-
name:
|
|
484
|
-
writable: true;
|
|
485
|
-
signer: true;
|
|
483
|
+
"name": "payer";
|
|
484
|
+
"writable": true;
|
|
485
|
+
"signer": true;
|
|
486
486
|
},
|
|
487
487
|
{
|
|
488
|
-
name:
|
|
489
|
-
address:
|
|
488
|
+
"name": "systemProgram";
|
|
489
|
+
"address": "11111111111111111111111111111111";
|
|
490
490
|
}
|
|
491
491
|
];
|
|
492
|
-
args: [
|
|
492
|
+
"args": [
|
|
493
493
|
{
|
|
494
|
-
name:
|
|
495
|
-
type:
|
|
494
|
+
"name": "amount";
|
|
495
|
+
"type": "u64";
|
|
496
496
|
}
|
|
497
497
|
];
|
|
498
498
|
},
|
|
499
499
|
{
|
|
500
|
-
name:
|
|
501
|
-
docs: [
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
500
|
+
"name": "withdraw";
|
|
501
|
+
"docs": [
|
|
502
|
+
"Withdraws collateral from a validator's bond.",
|
|
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."
|
|
512
512
|
];
|
|
513
|
-
discriminator: [
|
|
513
|
+
"discriminator": [
|
|
514
514
|
183,
|
|
515
515
|
18,
|
|
516
516
|
70,
|
|
@@ -520,15 +520,15 @@ type Jbond = {
|
|
|
520
520
|
161,
|
|
521
521
|
34
|
|
522
522
|
];
|
|
523
|
-
accounts: [
|
|
523
|
+
"accounts": [
|
|
524
524
|
{
|
|
525
|
-
name:
|
|
526
|
-
writable: true;
|
|
527
|
-
pda: {
|
|
528
|
-
seeds: [
|
|
525
|
+
"name": "validatorBond";
|
|
526
|
+
"writable": true;
|
|
527
|
+
"pda": {
|
|
528
|
+
"seeds": [
|
|
529
529
|
{
|
|
530
|
-
kind:
|
|
531
|
-
value: [
|
|
530
|
+
"kind": "const";
|
|
531
|
+
"value": [
|
|
532
532
|
118,
|
|
533
533
|
97,
|
|
534
534
|
108,
|
|
@@ -546,43 +546,43 @@ type Jbond = {
|
|
|
546
546
|
];
|
|
547
547
|
},
|
|
548
548
|
{
|
|
549
|
-
kind:
|
|
550
|
-
path:
|
|
551
|
-
account:
|
|
549
|
+
"kind": "account";
|
|
550
|
+
"path": "validator_bond.vote_account";
|
|
551
|
+
"account": "validatorBond";
|
|
552
552
|
}
|
|
553
553
|
];
|
|
554
554
|
};
|
|
555
555
|
},
|
|
556
556
|
{
|
|
557
|
-
name:
|
|
558
|
-
writable: true;
|
|
559
|
-
signer: true;
|
|
557
|
+
"name": "withdrawalAuthority";
|
|
558
|
+
"writable": true;
|
|
559
|
+
"signer": true;
|
|
560
560
|
},
|
|
561
561
|
{
|
|
562
|
-
name:
|
|
563
|
-
writable: true;
|
|
562
|
+
"name": "destination";
|
|
563
|
+
"writable": true;
|
|
564
564
|
},
|
|
565
565
|
{
|
|
566
|
-
name:
|
|
567
|
-
address:
|
|
566
|
+
"name": "epochSchedule";
|
|
567
|
+
"address": "SysvarEpochSchedu1e111111111111111111111111";
|
|
568
568
|
},
|
|
569
569
|
{
|
|
570
|
-
name:
|
|
571
|
-
address:
|
|
570
|
+
"name": "systemProgram";
|
|
571
|
+
"address": "11111111111111111111111111111111";
|
|
572
572
|
}
|
|
573
573
|
];
|
|
574
|
-
args: [
|
|
574
|
+
"args": [
|
|
575
575
|
{
|
|
576
|
-
name:
|
|
577
|
-
type:
|
|
576
|
+
"name": "amount";
|
|
577
|
+
"type": "u64";
|
|
578
578
|
}
|
|
579
579
|
];
|
|
580
580
|
}
|
|
581
581
|
];
|
|
582
|
-
accounts: [
|
|
582
|
+
"accounts": [
|
|
583
583
|
{
|
|
584
|
-
name:
|
|
585
|
-
discriminator: [
|
|
584
|
+
"name": "globalState";
|
|
585
|
+
"discriminator": [
|
|
586
586
|
163,
|
|
587
587
|
46,
|
|
588
588
|
74,
|
|
@@ -594,8 +594,8 @@ type Jbond = {
|
|
|
594
594
|
];
|
|
595
595
|
},
|
|
596
596
|
{
|
|
597
|
-
name:
|
|
598
|
-
discriminator: [
|
|
597
|
+
"name": "validatorBond";
|
|
598
|
+
"discriminator": [
|
|
599
599
|
82,
|
|
600
600
|
127,
|
|
601
601
|
243,
|
|
@@ -607,10 +607,10 @@ type Jbond = {
|
|
|
607
607
|
];
|
|
608
608
|
}
|
|
609
609
|
];
|
|
610
|
-
events: [
|
|
610
|
+
"events": [
|
|
611
611
|
{
|
|
612
|
-
name:
|
|
613
|
-
discriminator: [
|
|
612
|
+
"name": "collateralToppedUp";
|
|
613
|
+
"discriminator": [
|
|
614
614
|
189,
|
|
615
615
|
137,
|
|
616
616
|
204,
|
|
@@ -622,8 +622,8 @@ type Jbond = {
|
|
|
622
622
|
];
|
|
623
623
|
},
|
|
624
624
|
{
|
|
625
|
-
name:
|
|
626
|
-
discriminator: [
|
|
625
|
+
"name": "collateralWithdrawn";
|
|
626
|
+
"discriminator": [
|
|
627
627
|
51,
|
|
628
628
|
224,
|
|
629
629
|
133,
|
|
@@ -635,8 +635,8 @@ type Jbond = {
|
|
|
635
635
|
];
|
|
636
636
|
},
|
|
637
637
|
{
|
|
638
|
-
name:
|
|
639
|
-
discriminator: [
|
|
638
|
+
"name": "compensationClaimed";
|
|
639
|
+
"discriminator": [
|
|
640
640
|
36,
|
|
641
641
|
159,
|
|
642
642
|
41,
|
|
@@ -648,8 +648,8 @@ type Jbond = {
|
|
|
648
648
|
];
|
|
649
649
|
},
|
|
650
650
|
{
|
|
651
|
-
name:
|
|
652
|
-
discriminator: [
|
|
651
|
+
"name": "validatorRegistered";
|
|
652
|
+
"discriminator": [
|
|
653
653
|
20,
|
|
654
654
|
20,
|
|
655
655
|
190,
|
|
@@ -661,298 +661,298 @@ type Jbond = {
|
|
|
661
661
|
];
|
|
662
662
|
}
|
|
663
663
|
];
|
|
664
|
-
errors: [
|
|
664
|
+
"errors": [
|
|
665
665
|
{
|
|
666
|
-
code: 6000;
|
|
667
|
-
name:
|
|
668
|
-
msg:
|
|
666
|
+
"code": 6000;
|
|
667
|
+
"name": "invalidVoteAccount";
|
|
668
|
+
"msg": "Invalid vote account";
|
|
669
669
|
},
|
|
670
670
|
{
|
|
671
|
-
code: 6001;
|
|
672
|
-
name:
|
|
673
|
-
msg:
|
|
671
|
+
"code": 6001;
|
|
672
|
+
"name": "identityMismatch";
|
|
673
|
+
"msg": "Identity does not match vote account";
|
|
674
674
|
},
|
|
675
675
|
{
|
|
676
|
-
code: 6002;
|
|
677
|
-
name:
|
|
678
|
-
msg:
|
|
676
|
+
"code": 6002;
|
|
677
|
+
"name": "insufficientCollateral";
|
|
678
|
+
"msg": "Insufficient collateral amount";
|
|
679
679
|
},
|
|
680
680
|
{
|
|
681
|
-
code: 6003;
|
|
682
|
-
name:
|
|
683
|
-
msg:
|
|
681
|
+
"code": 6003;
|
|
682
|
+
"name": "targetAprTooLow";
|
|
683
|
+
"msg": "Target APR is below minimum threshold";
|
|
684
684
|
},
|
|
685
685
|
{
|
|
686
|
-
code: 6004;
|
|
687
|
-
name:
|
|
688
|
-
msg:
|
|
686
|
+
"code": 6004;
|
|
687
|
+
"name": "mathOverflow";
|
|
688
|
+
"msg": "Math overflow";
|
|
689
689
|
},
|
|
690
690
|
{
|
|
691
|
-
code: 6005;
|
|
692
|
-
name:
|
|
693
|
-
msg:
|
|
691
|
+
"code": 6005;
|
|
692
|
+
"name": "invalidAmount";
|
|
693
|
+
"msg": "Invalid amount";
|
|
694
694
|
},
|
|
695
695
|
{
|
|
696
|
-
code: 6006;
|
|
697
|
-
name:
|
|
698
|
-
msg:
|
|
696
|
+
"code": 6006;
|
|
697
|
+
"name": "validatorNotActive";
|
|
698
|
+
"msg": "Validator bond account is not active";
|
|
699
699
|
},
|
|
700
700
|
{
|
|
701
|
-
code: 6007;
|
|
702
|
-
name:
|
|
703
|
-
msg:
|
|
701
|
+
"code": 6007;
|
|
702
|
+
"name": "validatorAlreadyRegistered";
|
|
703
|
+
"msg": "Validator already registered";
|
|
704
704
|
},
|
|
705
705
|
{
|
|
706
|
-
code: 6008;
|
|
707
|
-
name:
|
|
708
|
-
msg:
|
|
706
|
+
"code": 6008;
|
|
707
|
+
"name": "unauthorized";
|
|
708
|
+
"msg": "unauthorized";
|
|
709
709
|
},
|
|
710
710
|
{
|
|
711
|
-
code: 6009;
|
|
712
|
-
name:
|
|
713
|
-
msg:
|
|
711
|
+
"code": 6009;
|
|
712
|
+
"name": "withdrawalLockedNearEpochEnd";
|
|
713
|
+
"msg": "Withdrawals are locked near the end of the epoch.";
|
|
714
714
|
}
|
|
715
715
|
];
|
|
716
|
-
types: [
|
|
716
|
+
"types": [
|
|
717
717
|
{
|
|
718
|
-
name:
|
|
719
|
-
type: {
|
|
720
|
-
kind:
|
|
721
|
-
fields: [
|
|
718
|
+
"name": "collateralToppedUp";
|
|
719
|
+
"type": {
|
|
720
|
+
"kind": "struct";
|
|
721
|
+
"fields": [
|
|
722
722
|
{
|
|
723
|
-
name:
|
|
724
|
-
type:
|
|
723
|
+
"name": "validator";
|
|
724
|
+
"type": "pubkey";
|
|
725
725
|
},
|
|
726
726
|
{
|
|
727
|
-
name:
|
|
728
|
-
type:
|
|
727
|
+
"name": "amount";
|
|
728
|
+
"type": "u64";
|
|
729
729
|
},
|
|
730
730
|
{
|
|
731
|
-
name:
|
|
732
|
-
type:
|
|
731
|
+
"name": "postBalance";
|
|
732
|
+
"type": "u64";
|
|
733
733
|
},
|
|
734
734
|
{
|
|
735
|
-
name:
|
|
736
|
-
type:
|
|
735
|
+
"name": "timestamp";
|
|
736
|
+
"type": "i64";
|
|
737
737
|
}
|
|
738
738
|
];
|
|
739
739
|
};
|
|
740
740
|
},
|
|
741
741
|
{
|
|
742
|
-
name:
|
|
743
|
-
type: {
|
|
744
|
-
kind:
|
|
745
|
-
fields: [
|
|
742
|
+
"name": "collateralWithdrawn";
|
|
743
|
+
"type": {
|
|
744
|
+
"kind": "struct";
|
|
745
|
+
"fields": [
|
|
746
746
|
{
|
|
747
|
-
name:
|
|
748
|
-
type:
|
|
747
|
+
"name": "validator";
|
|
748
|
+
"type": "pubkey";
|
|
749
749
|
},
|
|
750
750
|
{
|
|
751
|
-
name:
|
|
752
|
-
type:
|
|
751
|
+
"name": "amount";
|
|
752
|
+
"type": "u64";
|
|
753
753
|
},
|
|
754
754
|
{
|
|
755
|
-
name:
|
|
756
|
-
type:
|
|
755
|
+
"name": "postBalance";
|
|
756
|
+
"type": "u64";
|
|
757
757
|
},
|
|
758
758
|
{
|
|
759
|
-
name:
|
|
760
|
-
type:
|
|
759
|
+
"name": "timestamp";
|
|
760
|
+
"type": "i64";
|
|
761
761
|
}
|
|
762
762
|
];
|
|
763
763
|
};
|
|
764
764
|
},
|
|
765
765
|
{
|
|
766
|
-
name:
|
|
767
|
-
type: {
|
|
768
|
-
kind:
|
|
769
|
-
fields: [
|
|
766
|
+
"name": "compensationClaimed";
|
|
767
|
+
"type": {
|
|
768
|
+
"kind": "struct";
|
|
769
|
+
"fields": [
|
|
770
770
|
{
|
|
771
|
-
name:
|
|
772
|
-
type:
|
|
771
|
+
"name": "validator";
|
|
772
|
+
"type": "pubkey";
|
|
773
773
|
},
|
|
774
774
|
{
|
|
775
|
-
name:
|
|
776
|
-
type:
|
|
775
|
+
"name": "amount";
|
|
776
|
+
"type": "u64";
|
|
777
777
|
},
|
|
778
778
|
{
|
|
779
|
-
name:
|
|
780
|
-
type:
|
|
779
|
+
"name": "postBalance";
|
|
780
|
+
"type": "u64";
|
|
781
781
|
},
|
|
782
782
|
{
|
|
783
|
-
name:
|
|
784
|
-
type:
|
|
783
|
+
"name": "epoch";
|
|
784
|
+
"type": "u64";
|
|
785
785
|
},
|
|
786
786
|
{
|
|
787
|
-
name:
|
|
788
|
-
type:
|
|
787
|
+
"name": "timestamp";
|
|
788
|
+
"type": "i64";
|
|
789
789
|
}
|
|
790
790
|
];
|
|
791
791
|
};
|
|
792
792
|
},
|
|
793
793
|
{
|
|
794
|
-
name:
|
|
795
|
-
type: {
|
|
796
|
-
kind:
|
|
797
|
-
fields: [
|
|
794
|
+
"name": "configureData";
|
|
795
|
+
"type": {
|
|
796
|
+
"kind": "struct";
|
|
797
|
+
"fields": [
|
|
798
798
|
{
|
|
799
|
-
name:
|
|
800
|
-
type: {
|
|
801
|
-
option:
|
|
799
|
+
"name": "newAuthority";
|
|
800
|
+
"type": {
|
|
801
|
+
"option": "pubkey";
|
|
802
802
|
};
|
|
803
803
|
},
|
|
804
804
|
{
|
|
805
|
-
name:
|
|
806
|
-
type: {
|
|
807
|
-
option:
|
|
805
|
+
"name": "newReserve";
|
|
806
|
+
"type": {
|
|
807
|
+
"option": "pubkey";
|
|
808
808
|
};
|
|
809
809
|
}
|
|
810
810
|
];
|
|
811
811
|
};
|
|
812
812
|
},
|
|
813
813
|
{
|
|
814
|
-
name:
|
|
815
|
-
type: {
|
|
816
|
-
kind:
|
|
817
|
-
fields: [
|
|
814
|
+
"name": "globalState";
|
|
815
|
+
"type": {
|
|
816
|
+
"kind": "struct";
|
|
817
|
+
"fields": [
|
|
818
818
|
{
|
|
819
|
-
name:
|
|
820
|
-
docs: [
|
|
821
|
-
|
|
819
|
+
"name": "authority";
|
|
820
|
+
"docs": [
|
|
821
|
+
"The authority allowed to manage the program"
|
|
822
822
|
];
|
|
823
|
-
type:
|
|
823
|
+
"type": "pubkey";
|
|
824
824
|
},
|
|
825
825
|
{
|
|
826
|
-
name:
|
|
827
|
-
docs: [
|
|
828
|
-
|
|
826
|
+
"name": "reserve";
|
|
827
|
+
"docs": [
|
|
828
|
+
"The reserve vault holding SOL for bonding and compensation"
|
|
829
829
|
];
|
|
830
|
-
type:
|
|
830
|
+
"type": "pubkey";
|
|
831
831
|
},
|
|
832
832
|
{
|
|
833
|
-
name:
|
|
834
|
-
docs: [
|
|
835
|
-
|
|
833
|
+
"name": "totalValidators";
|
|
834
|
+
"docs": [
|
|
835
|
+
"Total number of registered validators"
|
|
836
836
|
];
|
|
837
|
-
type:
|
|
837
|
+
"type": "u16";
|
|
838
838
|
},
|
|
839
839
|
{
|
|
840
|
-
name:
|
|
841
|
-
docs: [
|
|
842
|
-
|
|
840
|
+
"name": "totalCompensationAmount";
|
|
841
|
+
"docs": [
|
|
842
|
+
"Total compensation amount paid out"
|
|
843
843
|
];
|
|
844
|
-
type:
|
|
844
|
+
"type": "u64";
|
|
845
845
|
},
|
|
846
846
|
{
|
|
847
|
-
name:
|
|
848
|
-
docs: [
|
|
849
|
-
|
|
847
|
+
"name": "bump";
|
|
848
|
+
"docs": [
|
|
849
|
+
"Bump for the PDA"
|
|
850
850
|
];
|
|
851
|
-
type:
|
|
851
|
+
"type": "u8";
|
|
852
852
|
}
|
|
853
853
|
];
|
|
854
854
|
};
|
|
855
855
|
},
|
|
856
856
|
{
|
|
857
|
-
name:
|
|
858
|
-
type: {
|
|
859
|
-
kind:
|
|
860
|
-
fields: [
|
|
857
|
+
"name": "validatorBond";
|
|
858
|
+
"type": {
|
|
859
|
+
"kind": "struct";
|
|
860
|
+
"fields": [
|
|
861
861
|
{
|
|
862
|
-
name:
|
|
863
|
-
docs: [
|
|
864
|
-
|
|
862
|
+
"name": "identity";
|
|
863
|
+
"docs": [
|
|
864
|
+
"The validator identity pubkey"
|
|
865
865
|
];
|
|
866
|
-
type:
|
|
866
|
+
"type": "pubkey";
|
|
867
867
|
},
|
|
868
868
|
{
|
|
869
|
-
name:
|
|
870
|
-
docs: [
|
|
871
|
-
|
|
869
|
+
"name": "voteAccount";
|
|
870
|
+
"docs": [
|
|
871
|
+
"The validator vote account pubkey"
|
|
872
872
|
];
|
|
873
|
-
type:
|
|
873
|
+
"type": "pubkey";
|
|
874
874
|
},
|
|
875
875
|
{
|
|
876
|
-
name:
|
|
877
|
-
docs: [
|
|
878
|
-
|
|
876
|
+
"name": "creator";
|
|
877
|
+
"docs": [
|
|
878
|
+
"Creator of the validator bond account"
|
|
879
879
|
];
|
|
880
|
-
type:
|
|
880
|
+
"type": "pubkey";
|
|
881
881
|
},
|
|
882
882
|
{
|
|
883
|
-
name:
|
|
884
|
-
docs: [
|
|
885
|
-
|
|
883
|
+
"name": "withdrawalAuthority";
|
|
884
|
+
"docs": [
|
|
885
|
+
"Authority allowed to withdraw funds (if None, only identity can withdraw)"
|
|
886
886
|
];
|
|
887
|
-
type: {
|
|
888
|
-
option:
|
|
887
|
+
"type": {
|
|
888
|
+
"option": "pubkey";
|
|
889
889
|
};
|
|
890
890
|
},
|
|
891
891
|
{
|
|
892
|
-
name:
|
|
893
|
-
docs: [
|
|
894
|
-
|
|
892
|
+
"name": "totalCompensationAmount";
|
|
893
|
+
"docs": [
|
|
894
|
+
"Total compensation claimed for the validator"
|
|
895
895
|
];
|
|
896
|
-
type:
|
|
896
|
+
"type": "u64";
|
|
897
897
|
},
|
|
898
898
|
{
|
|
899
|
-
name:
|
|
900
|
-
docs: [
|
|
901
|
-
|
|
899
|
+
"name": "lastCompensationAmount";
|
|
900
|
+
"docs": [
|
|
901
|
+
"Last compensation amount claimed"
|
|
902
902
|
];
|
|
903
|
-
type:
|
|
903
|
+
"type": "u64";
|
|
904
904
|
},
|
|
905
905
|
{
|
|
906
|
-
name:
|
|
907
|
-
docs: [
|
|
908
|
-
|
|
906
|
+
"name": "lastCompensationEpoch";
|
|
907
|
+
"docs": [
|
|
908
|
+
"Last epoch when compensation was claimed"
|
|
909
909
|
];
|
|
910
|
-
type:
|
|
910
|
+
"type": "u64";
|
|
911
911
|
},
|
|
912
912
|
{
|
|
913
|
-
name:
|
|
914
|
-
docs: [
|
|
915
|
-
|
|
913
|
+
"name": "createdAt";
|
|
914
|
+
"docs": [
|
|
915
|
+
"Timestamp when the bond account was created"
|
|
916
916
|
];
|
|
917
|
-
type:
|
|
917
|
+
"type": "i64";
|
|
918
918
|
},
|
|
919
919
|
{
|
|
920
|
-
name:
|
|
921
|
-
docs: [
|
|
922
|
-
|
|
920
|
+
"name": "isActive";
|
|
921
|
+
"docs": [
|
|
922
|
+
"Whether the validator is currently active"
|
|
923
923
|
];
|
|
924
|
-
type:
|
|
924
|
+
"type": "bool";
|
|
925
925
|
},
|
|
926
926
|
{
|
|
927
|
-
name:
|
|
928
|
-
docs: [
|
|
929
|
-
|
|
927
|
+
"name": "bump";
|
|
928
|
+
"docs": [
|
|
929
|
+
"Bump for the PDA"
|
|
930
930
|
];
|
|
931
|
-
type:
|
|
931
|
+
"type": "u8";
|
|
932
932
|
}
|
|
933
933
|
];
|
|
934
934
|
};
|
|
935
935
|
},
|
|
936
936
|
{
|
|
937
|
-
name:
|
|
938
|
-
type: {
|
|
939
|
-
kind:
|
|
940
|
-
fields: [
|
|
937
|
+
"name": "validatorRegistered";
|
|
938
|
+
"type": {
|
|
939
|
+
"kind": "struct";
|
|
940
|
+
"fields": [
|
|
941
941
|
{
|
|
942
|
-
name:
|
|
943
|
-
type:
|
|
942
|
+
"name": "identity";
|
|
943
|
+
"type": "pubkey";
|
|
944
944
|
},
|
|
945
945
|
{
|
|
946
|
-
name:
|
|
947
|
-
type:
|
|
946
|
+
"name": "voteAccount";
|
|
947
|
+
"type": "pubkey";
|
|
948
948
|
},
|
|
949
949
|
{
|
|
950
|
-
name:
|
|
951
|
-
type:
|
|
950
|
+
"name": "initialCollateral";
|
|
951
|
+
"type": "u64";
|
|
952
952
|
},
|
|
953
953
|
{
|
|
954
|
-
name:
|
|
955
|
-
type:
|
|
954
|
+
"name": "timestamp";
|
|
955
|
+
"type": "i64";
|
|
956
956
|
}
|
|
957
957
|
];
|
|
958
958
|
};
|
|
@@ -1076,14 +1076,13 @@ declare enum BondClientEnv {
|
|
|
1076
1076
|
* Options for configuring the JBondClient.
|
|
1077
1077
|
*/
|
|
1078
1078
|
type ClientOptions = {
|
|
1079
|
-
programId?: PublicKey;
|
|
1080
1079
|
debug?: boolean;
|
|
1081
1080
|
} & Record<string, any>;
|
|
1082
1081
|
declare class JBondClient {
|
|
1083
|
-
readonly provider:
|
|
1082
|
+
readonly provider: Provider;
|
|
1084
1083
|
readonly options: ClientOptions;
|
|
1085
1084
|
readonly program: Program<Jbond>;
|
|
1086
|
-
constructor(provider:
|
|
1085
|
+
constructor(provider: Provider, options?: ClientOptions);
|
|
1087
1086
|
/**
|
|
1088
1087
|
* Creates an instance of `JBondClient` using a provided connection and wallet.
|
|
1089
1088
|
*/
|
|
@@ -1095,7 +1094,7 @@ declare class JBondClient {
|
|
|
1095
1094
|
/**
|
|
1096
1095
|
* Get the current program ID.
|
|
1097
1096
|
*/
|
|
1098
|
-
get programId():
|
|
1097
|
+
get programId(): any;
|
|
1099
1098
|
/**
|
|
1100
1099
|
* Get the current connection.
|
|
1101
1100
|
*/
|
|
@@ -1119,44 +1118,44 @@ declare class JBondClient {
|
|
|
1119
1118
|
* Initialize the program
|
|
1120
1119
|
* Default authority is the provider's wallet
|
|
1121
1120
|
*/
|
|
1122
|
-
initialize(props: InitializeProps): Promise<string>;
|
|
1121
|
+
initialize(props: InitializeProps): Promise<string | undefined>;
|
|
1123
1122
|
/**
|
|
1124
1123
|
* Register a new validator
|
|
1125
1124
|
* Default creator is the provider's wallet
|
|
1126
1125
|
*/
|
|
1127
|
-
registerValidator(props: RegisterValidatorProps): Promise<string>;
|
|
1126
|
+
registerValidator(props: RegisterValidatorProps): Promise<string | undefined>;
|
|
1128
1127
|
/**
|
|
1129
1128
|
* Top up collateral
|
|
1130
1129
|
* Default payer is the provider's wallet
|
|
1131
1130
|
*/
|
|
1132
|
-
topUpCollateral(props: TopUpCollateralProps): Promise<string>;
|
|
1131
|
+
topUpCollateral(props: TopUpCollateralProps): Promise<string | undefined>;
|
|
1133
1132
|
/**
|
|
1134
1133
|
* Withdraw collateral
|
|
1135
1134
|
* Default withdrawal authority is the provider's wallet
|
|
1136
1135
|
* Default destination is the provider's wallet
|
|
1137
1136
|
* @return Transaction signature
|
|
1138
1137
|
*/
|
|
1139
|
-
withdrawCollateral(props: WithdrawCollateralProps): Promise<string>;
|
|
1138
|
+
withdrawCollateral(props: WithdrawCollateralProps): Promise<string | undefined>;
|
|
1140
1139
|
/**
|
|
1141
1140
|
* Claim compensation
|
|
1142
1141
|
* Default authority is the provider's wallet
|
|
1143
1142
|
* @return Transaction signature
|
|
1144
1143
|
*/
|
|
1145
|
-
claimCompensation(props: ClaimProps): Promise<string>;
|
|
1144
|
+
claimCompensation(props: ClaimProps): Promise<string | undefined>;
|
|
1146
1145
|
/**
|
|
1147
1146
|
* Update global configuration for the program
|
|
1148
1147
|
* Default authority is the provider's wallet
|
|
1149
1148
|
* Only the current authority can call this
|
|
1150
1149
|
* @return Transaction signature
|
|
1151
1150
|
*/
|
|
1152
|
-
configure(props: ConfigureProps): Promise<string>;
|
|
1151
|
+
configure(props: ConfigureProps): Promise<string | undefined>;
|
|
1153
1152
|
/**
|
|
1154
1153
|
* Set withdrawal authority for validator bond
|
|
1155
1154
|
* Only the validator identity can call this
|
|
1156
1155
|
* Default identity is the provider's wallet
|
|
1157
1156
|
* @return Transaction signature
|
|
1158
1157
|
*/
|
|
1159
|
-
setWithdrawAuthority(props: SetWithdrawAuthorityProps): Promise<string>;
|
|
1158
|
+
setWithdrawAuthority(props: SetWithdrawAuthorityProps): Promise<string | undefined>;
|
|
1160
1159
|
/**
|
|
1161
1160
|
* Build initialize instruction
|
|
1162
1161
|
*/
|
|
@@ -1217,12 +1216,21 @@ declare class JBondClient {
|
|
|
1217
1216
|
private getInstructionDiscriminator;
|
|
1218
1217
|
private fetchSignaturesForValidator;
|
|
1219
1218
|
private fetchParsedTransactions;
|
|
1219
|
+
/**
|
|
1220
|
+
* Decode instruction data to determine transaction type and amount
|
|
1221
|
+
* @param data
|
|
1222
|
+
* @private
|
|
1223
|
+
*/
|
|
1220
1224
|
private decodeInstructionData;
|
|
1221
1225
|
}
|
|
1222
1226
|
|
|
1227
|
+
declare enum Seeds {
|
|
1228
|
+
GlobalState = "global_state",
|
|
1229
|
+
ValidatorBond = "validator_bond"
|
|
1230
|
+
}
|
|
1223
1231
|
/**
|
|
1224
1232
|
* Program IDs for different environments
|
|
1225
1233
|
*/
|
|
1226
1234
|
declare const ENV_PROGRAM_ID: Record<string, PublicKey>;
|
|
1227
1235
|
|
|
1228
|
-
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 };
|
|
1236
|
+
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, Seeds, type SetWithdrawAuthorityProps, type TopUpCollateralProps, type TransactionHistoryItem, type ValidatorBond, type WithdrawCollateralProps };
|