@jpool/bond-sdk 0.9.0-next.0 → 0.9.0-next.2
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 +24 -26
- package/dist/index.d.ts +24 -26
- package/dist/index.js +143 -159
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +143 -160
- 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.
|
|
@@ -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
|
*/
|
|
@@ -1200,13 +1199,6 @@ declare class JBondClient {
|
|
|
1200
1199
|
* @return Balance in SOL
|
|
1201
1200
|
*/
|
|
1202
1201
|
getValidatorBondBalance(vote: PublicKeyInitData): Promise<number>;
|
|
1203
|
-
/**
|
|
1204
|
-
* Get transaction history grouped by epochs
|
|
1205
|
-
* @param vote - The vote account to get history for
|
|
1206
|
-
* @param epochsCount - Number of recent epochs to return (default: 10)
|
|
1207
|
-
* @returns Array of epoch history items sorted by epoch (descending)
|
|
1208
|
-
*/
|
|
1209
|
-
getHistoryGroupedByEpochs(vote: PublicKeyInitData, epochsCount?: number): Promise<EpochHistoryItem[]>;
|
|
1210
1202
|
/**
|
|
1211
1203
|
* Get transaction history for a specific validator bond account
|
|
1212
1204
|
*/
|
|
@@ -1216,23 +1208,29 @@ declare class JBondClient {
|
|
|
1216
1208
|
before?: string;
|
|
1217
1209
|
until?: string;
|
|
1218
1210
|
}): Promise<TransactionHistoryItem[]>;
|
|
1219
|
-
/**
|
|
1220
|
-
* Get full transaction history by paginating through results
|
|
1221
|
-
* @param voteAccount
|
|
1222
|
-
* @param pageSize
|
|
1223
|
-
*/
|
|
1224
|
-
getFullHistory(voteAccount: PublicKey, pageSize?: number): Promise<TransactionHistoryItem[]>;
|
|
1225
1211
|
/**
|
|
1226
1212
|
* Get instruction discriminator from IDL
|
|
1227
1213
|
* @param instructionName
|
|
1228
1214
|
* @private
|
|
1229
1215
|
*/
|
|
1230
1216
|
private getInstructionDiscriminator;
|
|
1217
|
+
private fetchSignaturesForValidator;
|
|
1218
|
+
private fetchParsedTransactions;
|
|
1219
|
+
/**
|
|
1220
|
+
* Decode instruction data to determine transaction type and amount
|
|
1221
|
+
* @param data
|
|
1222
|
+
* @private
|
|
1223
|
+
*/
|
|
1224
|
+
private decodeInstructionData;
|
|
1231
1225
|
}
|
|
1232
1226
|
|
|
1227
|
+
declare enum Seeds {
|
|
1228
|
+
GlobalState = "global_state",
|
|
1229
|
+
ValidatorBond = "validator_bond"
|
|
1230
|
+
}
|
|
1233
1231
|
/**
|
|
1234
1232
|
* Program IDs for different environments
|
|
1235
1233
|
*/
|
|
1236
1234
|
declare const ENV_PROGRAM_ID: Record<string, PublicKey>;
|
|
1237
1235
|
|
|
1238
|
-
export { BondClientEnv, BondTransactionType, type ClaimProps, type ClientOptions, type ConfigureProps, ENV_PROGRAM_ID, type EpochHistoryItem, type GetHistoryGroupedProps, type GetHistoryProps, type GlobalState, type InitializeProps, JBondClient, type Jbond, NodeWallet, type RegisterValidatorProps, type SetWithdrawAuthorityProps, type TopUpCollateralProps, type TransactionHistoryItem, type ValidatorBond, type WithdrawCollateralProps };
|
|
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 };
|
package/dist/index.d.ts
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.
|
|
@@ -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
|
*/
|
|
@@ -1200,13 +1199,6 @@ declare class JBondClient {
|
|
|
1200
1199
|
* @return Balance in SOL
|
|
1201
1200
|
*/
|
|
1202
1201
|
getValidatorBondBalance(vote: PublicKeyInitData): Promise<number>;
|
|
1203
|
-
/**
|
|
1204
|
-
* Get transaction history grouped by epochs
|
|
1205
|
-
* @param vote - The vote account to get history for
|
|
1206
|
-
* @param epochsCount - Number of recent epochs to return (default: 10)
|
|
1207
|
-
* @returns Array of epoch history items sorted by epoch (descending)
|
|
1208
|
-
*/
|
|
1209
|
-
getHistoryGroupedByEpochs(vote: PublicKeyInitData, epochsCount?: number): Promise<EpochHistoryItem[]>;
|
|
1210
1202
|
/**
|
|
1211
1203
|
* Get transaction history for a specific validator bond account
|
|
1212
1204
|
*/
|
|
@@ -1216,23 +1208,29 @@ declare class JBondClient {
|
|
|
1216
1208
|
before?: string;
|
|
1217
1209
|
until?: string;
|
|
1218
1210
|
}): Promise<TransactionHistoryItem[]>;
|
|
1219
|
-
/**
|
|
1220
|
-
* Get full transaction history by paginating through results
|
|
1221
|
-
* @param voteAccount
|
|
1222
|
-
* @param pageSize
|
|
1223
|
-
*/
|
|
1224
|
-
getFullHistory(voteAccount: PublicKey, pageSize?: number): Promise<TransactionHistoryItem[]>;
|
|
1225
1211
|
/**
|
|
1226
1212
|
* Get instruction discriminator from IDL
|
|
1227
1213
|
* @param instructionName
|
|
1228
1214
|
* @private
|
|
1229
1215
|
*/
|
|
1230
1216
|
private getInstructionDiscriminator;
|
|
1217
|
+
private fetchSignaturesForValidator;
|
|
1218
|
+
private fetchParsedTransactions;
|
|
1219
|
+
/**
|
|
1220
|
+
* Decode instruction data to determine transaction type and amount
|
|
1221
|
+
* @param data
|
|
1222
|
+
* @private
|
|
1223
|
+
*/
|
|
1224
|
+
private decodeInstructionData;
|
|
1231
1225
|
}
|
|
1232
1226
|
|
|
1227
|
+
declare enum Seeds {
|
|
1228
|
+
GlobalState = "global_state",
|
|
1229
|
+
ValidatorBond = "validator_bond"
|
|
1230
|
+
}
|
|
1233
1231
|
/**
|
|
1234
1232
|
* Program IDs for different environments
|
|
1235
1233
|
*/
|
|
1236
1234
|
declare const ENV_PROGRAM_ID: Record<string, PublicKey>;
|
|
1237
1235
|
|
|
1238
|
-
export { BondClientEnv, BondTransactionType, type ClaimProps, type ClientOptions, type ConfigureProps, ENV_PROGRAM_ID, type EpochHistoryItem, type GetHistoryGroupedProps, type GetHistoryProps, type GlobalState, type InitializeProps, JBondClient, type Jbond, NodeWallet, type RegisterValidatorProps, type SetWithdrawAuthorityProps, type TopUpCollateralProps, type TransactionHistoryItem, type ValidatorBond, type WithdrawCollateralProps };
|
|
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 };
|