@jpool/bond-sdk 0.11.0-next.17 → 0.11.0-next.19
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 +42 -1
- package/dist/index.d.ts +42 -1
- package/dist/index.js +51 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +51 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -520,6 +520,37 @@ type Jbond = {
|
|
|
520
520
|
}
|
|
521
521
|
];
|
|
522
522
|
},
|
|
523
|
+
{
|
|
524
|
+
"name": "bondRemove";
|
|
525
|
+
"docs": [
|
|
526
|
+
"Removes bond state"
|
|
527
|
+
];
|
|
528
|
+
"discriminator": [
|
|
529
|
+
121,
|
|
530
|
+
112,
|
|
531
|
+
246,
|
|
532
|
+
177,
|
|
533
|
+
181,
|
|
534
|
+
8,
|
|
535
|
+
18,
|
|
536
|
+
220
|
|
537
|
+
];
|
|
538
|
+
"accounts": [
|
|
539
|
+
{
|
|
540
|
+
"name": "bondState";
|
|
541
|
+
"writable": true;
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
"name": "authority";
|
|
545
|
+
"writable": true;
|
|
546
|
+
"signer": true;
|
|
547
|
+
"relations": [
|
|
548
|
+
"bondState"
|
|
549
|
+
];
|
|
550
|
+
}
|
|
551
|
+
];
|
|
552
|
+
"args": [];
|
|
553
|
+
},
|
|
523
554
|
{
|
|
524
555
|
"name": "bondSetWithdrawAuthority";
|
|
525
556
|
"docs": [
|
|
@@ -1933,6 +1964,11 @@ type BondFinishProps = {
|
|
|
1933
1964
|
bondType: BondType;
|
|
1934
1965
|
name: string;
|
|
1935
1966
|
};
|
|
1967
|
+
type BondRemoveProps = {
|
|
1968
|
+
bondType: BondType;
|
|
1969
|
+
name: string;
|
|
1970
|
+
authority?: PublicKey;
|
|
1971
|
+
};
|
|
1936
1972
|
|
|
1937
1973
|
type GetHistoryOpts = {
|
|
1938
1974
|
cluster?: Cluster;
|
|
@@ -2074,6 +2110,7 @@ declare class JBondClient {
|
|
|
2074
2110
|
* Finish crowdfunding bond session
|
|
2075
2111
|
*/
|
|
2076
2112
|
bondFinish(props: BondFinishProps): Promise<string | undefined>;
|
|
2113
|
+
bondRemove(props: BondRemoveProps): Promise<string | undefined>;
|
|
2077
2114
|
/**
|
|
2078
2115
|
* Build global state initialize instruction
|
|
2079
2116
|
*/
|
|
@@ -2142,6 +2179,10 @@ declare class JBondClient {
|
|
|
2142
2179
|
voteAccount: PublicKeyInitData;
|
|
2143
2180
|
payer: PublicKey;
|
|
2144
2181
|
}): Promise<TransactionInstruction>;
|
|
2182
|
+
/**
|
|
2183
|
+
* Build bond remove instruction
|
|
2184
|
+
*/
|
|
2185
|
+
getBondRemoveIx(props: BondRemoveProps): Promise<TransactionInstruction>;
|
|
2145
2186
|
/**
|
|
2146
2187
|
* Build test set last update epoch instruction
|
|
2147
2188
|
* NOTE!: This instruction is for testing purposes only.
|
|
@@ -2341,4 +2382,4 @@ declare const CROWDFUNDING_BOND_SEED = "crowdfunding";
|
|
|
2341
2382
|
*/
|
|
2342
2383
|
declare const ENV_PROGRAM_ID: Record<string, PublicKey>;
|
|
2343
2384
|
|
|
2344
|
-
export { BOND_STATE_SEED, type BondConfigureProps, type BondFinishProps, type BondInitializeProps, type BondLockFunds, type BondReleaseFunds, type BondStartProps, type BondState, type BondStateStats, type BondStateStatus, BondTransactionType, BondType, CROWDFUNDING_BOND_SEED, type ClaimAllProps, type ClaimProps, type CollateralType, ENV_PROGRAM_ID, type EpochHistoryItem, GLOBAL_STATE_SEED, type GetHistoryGroupedProps, type GetHistoryProps, type GlobalConfigureProps, type GlobalInitializeProps, type GlobalState, JBondClient, JBondClientEnv, type JBondClientOptions, type Jbond, NodeWallet, type RegisterValidatorProps, STANDARD_BOND_SEED, SessionStatus, type SetWithdrawAuthorityProps, type TopUpCollateralProps, type TransactionHistoryItem, VALIDATOR_BOND_SEED, type ValidatorBond, type WithdrawCollateralProps };
|
|
2385
|
+
export { BOND_STATE_SEED, type BondConfigureProps, type BondFinishProps, type BondInitializeProps, type BondLockFunds, type BondReleaseFunds, type BondRemoveProps, type BondStartProps, type BondState, type BondStateStats, type BondStateStatus, BondTransactionType, BondType, CROWDFUNDING_BOND_SEED, type ClaimAllProps, type ClaimProps, type CollateralType, ENV_PROGRAM_ID, type EpochHistoryItem, GLOBAL_STATE_SEED, type GetHistoryGroupedProps, type GetHistoryProps, type GlobalConfigureProps, type GlobalInitializeProps, type GlobalState, JBondClient, JBondClientEnv, type JBondClientOptions, type Jbond, NodeWallet, type RegisterValidatorProps, STANDARD_BOND_SEED, SessionStatus, type SetWithdrawAuthorityProps, type TopUpCollateralProps, type TransactionHistoryItem, VALIDATOR_BOND_SEED, type ValidatorBond, type WithdrawCollateralProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -520,6 +520,37 @@ type Jbond = {
|
|
|
520
520
|
}
|
|
521
521
|
];
|
|
522
522
|
},
|
|
523
|
+
{
|
|
524
|
+
"name": "bondRemove";
|
|
525
|
+
"docs": [
|
|
526
|
+
"Removes bond state"
|
|
527
|
+
];
|
|
528
|
+
"discriminator": [
|
|
529
|
+
121,
|
|
530
|
+
112,
|
|
531
|
+
246,
|
|
532
|
+
177,
|
|
533
|
+
181,
|
|
534
|
+
8,
|
|
535
|
+
18,
|
|
536
|
+
220
|
|
537
|
+
];
|
|
538
|
+
"accounts": [
|
|
539
|
+
{
|
|
540
|
+
"name": "bondState";
|
|
541
|
+
"writable": true;
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
"name": "authority";
|
|
545
|
+
"writable": true;
|
|
546
|
+
"signer": true;
|
|
547
|
+
"relations": [
|
|
548
|
+
"bondState"
|
|
549
|
+
];
|
|
550
|
+
}
|
|
551
|
+
];
|
|
552
|
+
"args": [];
|
|
553
|
+
},
|
|
523
554
|
{
|
|
524
555
|
"name": "bondSetWithdrawAuthority";
|
|
525
556
|
"docs": [
|
|
@@ -1933,6 +1964,11 @@ type BondFinishProps = {
|
|
|
1933
1964
|
bondType: BondType;
|
|
1934
1965
|
name: string;
|
|
1935
1966
|
};
|
|
1967
|
+
type BondRemoveProps = {
|
|
1968
|
+
bondType: BondType;
|
|
1969
|
+
name: string;
|
|
1970
|
+
authority?: PublicKey;
|
|
1971
|
+
};
|
|
1936
1972
|
|
|
1937
1973
|
type GetHistoryOpts = {
|
|
1938
1974
|
cluster?: Cluster;
|
|
@@ -2074,6 +2110,7 @@ declare class JBondClient {
|
|
|
2074
2110
|
* Finish crowdfunding bond session
|
|
2075
2111
|
*/
|
|
2076
2112
|
bondFinish(props: BondFinishProps): Promise<string | undefined>;
|
|
2113
|
+
bondRemove(props: BondRemoveProps): Promise<string | undefined>;
|
|
2077
2114
|
/**
|
|
2078
2115
|
* Build global state initialize instruction
|
|
2079
2116
|
*/
|
|
@@ -2142,6 +2179,10 @@ declare class JBondClient {
|
|
|
2142
2179
|
voteAccount: PublicKeyInitData;
|
|
2143
2180
|
payer: PublicKey;
|
|
2144
2181
|
}): Promise<TransactionInstruction>;
|
|
2182
|
+
/**
|
|
2183
|
+
* Build bond remove instruction
|
|
2184
|
+
*/
|
|
2185
|
+
getBondRemoveIx(props: BondRemoveProps): Promise<TransactionInstruction>;
|
|
2145
2186
|
/**
|
|
2146
2187
|
* Build test set last update epoch instruction
|
|
2147
2188
|
* NOTE!: This instruction is for testing purposes only.
|
|
@@ -2341,4 +2382,4 @@ declare const CROWDFUNDING_BOND_SEED = "crowdfunding";
|
|
|
2341
2382
|
*/
|
|
2342
2383
|
declare const ENV_PROGRAM_ID: Record<string, PublicKey>;
|
|
2343
2384
|
|
|
2344
|
-
export { BOND_STATE_SEED, type BondConfigureProps, type BondFinishProps, type BondInitializeProps, type BondLockFunds, type BondReleaseFunds, type BondStartProps, type BondState, type BondStateStats, type BondStateStatus, BondTransactionType, BondType, CROWDFUNDING_BOND_SEED, type ClaimAllProps, type ClaimProps, type CollateralType, ENV_PROGRAM_ID, type EpochHistoryItem, GLOBAL_STATE_SEED, type GetHistoryGroupedProps, type GetHistoryProps, type GlobalConfigureProps, type GlobalInitializeProps, type GlobalState, JBondClient, JBondClientEnv, type JBondClientOptions, type Jbond, NodeWallet, type RegisterValidatorProps, STANDARD_BOND_SEED, SessionStatus, type SetWithdrawAuthorityProps, type TopUpCollateralProps, type TransactionHistoryItem, VALIDATOR_BOND_SEED, type ValidatorBond, type WithdrawCollateralProps };
|
|
2385
|
+
export { BOND_STATE_SEED, type BondConfigureProps, type BondFinishProps, type BondInitializeProps, type BondLockFunds, type BondReleaseFunds, type BondRemoveProps, type BondStartProps, type BondState, type BondStateStats, type BondStateStatus, BondTransactionType, BondType, CROWDFUNDING_BOND_SEED, type ClaimAllProps, type ClaimProps, type CollateralType, ENV_PROGRAM_ID, type EpochHistoryItem, GLOBAL_STATE_SEED, type GetHistoryGroupedProps, type GetHistoryProps, type GlobalConfigureProps, type GlobalInitializeProps, type GlobalState, JBondClient, JBondClientEnv, type JBondClientOptions, type Jbond, NodeWallet, type RegisterValidatorProps, STANDARD_BOND_SEED, SessionStatus, type SetWithdrawAuthorityProps, type TopUpCollateralProps, type TransactionHistoryItem, VALIDATOR_BOND_SEED, type ValidatorBond, type WithdrawCollateralProps };
|
package/dist/index.js
CHANGED
|
@@ -4574,7 +4574,8 @@ var VALIDATOR_BOND_SEED = "validator_bond";
|
|
|
4574
4574
|
var STANDARD_BOND_SEED = "standard";
|
|
4575
4575
|
var CROWDFUNDING_BOND_SEED = "crowdfunding";
|
|
4576
4576
|
var ENV_PROGRAM_ID = {
|
|
4577
|
-
|
|
4577
|
+
["dev" /* DEV */]: new web3_js.PublicKey("Fo17edWRJewZNTRibgx9iTfjywCW6dzS81VwBLmPFVq1"),
|
|
4578
|
+
["prod" /* PROD */]: new web3_js.PublicKey("BondQ7KqZreTcW2UbeTNDcLCJQ3aXAtLn2Fm6ftaJDU")
|
|
4578
4579
|
};
|
|
4579
4580
|
|
|
4580
4581
|
// src/history.ts
|
|
@@ -5268,6 +5269,37 @@ var jbond_default = {
|
|
|
5268
5269
|
}
|
|
5269
5270
|
]
|
|
5270
5271
|
},
|
|
5272
|
+
{
|
|
5273
|
+
name: "bond_remove",
|
|
5274
|
+
docs: [
|
|
5275
|
+
"Removes bond state"
|
|
5276
|
+
],
|
|
5277
|
+
discriminator: [
|
|
5278
|
+
121,
|
|
5279
|
+
112,
|
|
5280
|
+
246,
|
|
5281
|
+
177,
|
|
5282
|
+
181,
|
|
5283
|
+
8,
|
|
5284
|
+
18,
|
|
5285
|
+
220
|
|
5286
|
+
],
|
|
5287
|
+
accounts: [
|
|
5288
|
+
{
|
|
5289
|
+
name: "bond_state",
|
|
5290
|
+
writable: true
|
|
5291
|
+
},
|
|
5292
|
+
{
|
|
5293
|
+
name: "authority",
|
|
5294
|
+
writable: true,
|
|
5295
|
+
signer: true,
|
|
5296
|
+
relations: [
|
|
5297
|
+
"bond_state"
|
|
5298
|
+
]
|
|
5299
|
+
}
|
|
5300
|
+
],
|
|
5301
|
+
args: []
|
|
5302
|
+
},
|
|
5271
5303
|
{
|
|
5272
5304
|
name: "bond_set_withdraw_authority",
|
|
5273
5305
|
docs: [
|
|
@@ -6714,7 +6746,11 @@ var JBondClient = class _JBondClient {
|
|
|
6714
6746
|
* Set the environment.
|
|
6715
6747
|
*/
|
|
6716
6748
|
env(env) {
|
|
6717
|
-
|
|
6749
|
+
const envProgramId = ENV_PROGRAM_ID[env];
|
|
6750
|
+
if (!envProgramId) {
|
|
6751
|
+
throw new Error(`Invalid environment: ${env}`);
|
|
6752
|
+
}
|
|
6753
|
+
return this.configure("programId", envProgramId);
|
|
6718
6754
|
}
|
|
6719
6755
|
/**
|
|
6720
6756
|
* Configure a specific option.
|
|
@@ -6831,6 +6867,10 @@ var JBondClient = class _JBondClient {
|
|
|
6831
6867
|
const ix = await this.getBondSessionFinishIx(props);
|
|
6832
6868
|
return this.provider.sendAndConfirm?.(new web3_js.Transaction().add(ix));
|
|
6833
6869
|
}
|
|
6870
|
+
async bondRemove(props) {
|
|
6871
|
+
const ix = await this.getBondRemoveIx(props);
|
|
6872
|
+
return this.provider.sendAndConfirm?.(new web3_js.Transaction().add(ix));
|
|
6873
|
+
}
|
|
6834
6874
|
/**
|
|
6835
6875
|
* Build global state initialize instruction
|
|
6836
6876
|
*/
|
|
@@ -7132,6 +7172,15 @@ var JBondClient = class _JBondClient {
|
|
|
7132
7172
|
const [validatorBond, _] = this.pda.validatorBond(bondType, bondName, voteAccount);
|
|
7133
7173
|
return this.program.methods.bondUpdate().accountsPartial({ validatorBond, payer }).instruction();
|
|
7134
7174
|
}
|
|
7175
|
+
/**
|
|
7176
|
+
* Build bond remove instruction
|
|
7177
|
+
*/
|
|
7178
|
+
async getBondRemoveIx(props) {
|
|
7179
|
+
const { bondType, name } = props;
|
|
7180
|
+
const [bondState] = this.pda.bondState(bondType, name);
|
|
7181
|
+
const authority = props.authority ?? this.provider.wallet?.publicKey;
|
|
7182
|
+
return this.program.methods.bondRemove().accountsPartial({ bondState, authority }).instruction();
|
|
7183
|
+
}
|
|
7135
7184
|
/**
|
|
7136
7185
|
* Build test set last update epoch instruction
|
|
7137
7186
|
* NOTE!: This instruction is for testing purposes only.
|