@jpool/bond-sdk 0.11.0-next.7 → 0.11.0-next.8
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 +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +12 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1832,6 +1832,7 @@ type BondLockFunds = {
|
|
|
1832
1832
|
bondType: BondType;
|
|
1833
1833
|
name: string;
|
|
1834
1834
|
amount: number;
|
|
1835
|
+
withdrawAuthority: PublicKey;
|
|
1835
1836
|
voteAccount: PublicKey;
|
|
1836
1837
|
collateralType?: CollateralType;
|
|
1837
1838
|
};
|
|
@@ -1839,6 +1840,7 @@ type BondReleaseFunds = {
|
|
|
1839
1840
|
bondType: BondType;
|
|
1840
1841
|
name: string;
|
|
1841
1842
|
amount: number;
|
|
1843
|
+
withdrawAuthority: PublicKey;
|
|
1842
1844
|
voteAccount: PublicKey;
|
|
1843
1845
|
};
|
|
1844
1846
|
type ClaimAllProps = {
|
|
@@ -2091,6 +2093,8 @@ declare class JBondClient {
|
|
|
2091
2093
|
* Build start crowdfunding session instruction
|
|
2092
2094
|
*/
|
|
2093
2095
|
getBondSessionStartIx(props: BondStartProps): Promise<TransactionInstruction>;
|
|
2096
|
+
lockFunds(props: BondLockFunds): Promise<string | undefined>;
|
|
2097
|
+
releaseFunds(props: BondReleaseFunds): Promise<string | undefined>;
|
|
2094
2098
|
/**
|
|
2095
2099
|
* Build lock funds instruction
|
|
2096
2100
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -1832,6 +1832,7 @@ type BondLockFunds = {
|
|
|
1832
1832
|
bondType: BondType;
|
|
1833
1833
|
name: string;
|
|
1834
1834
|
amount: number;
|
|
1835
|
+
withdrawAuthority: PublicKey;
|
|
1835
1836
|
voteAccount: PublicKey;
|
|
1836
1837
|
collateralType?: CollateralType;
|
|
1837
1838
|
};
|
|
@@ -1839,6 +1840,7 @@ type BondReleaseFunds = {
|
|
|
1839
1840
|
bondType: BondType;
|
|
1840
1841
|
name: string;
|
|
1841
1842
|
amount: number;
|
|
1843
|
+
withdrawAuthority: PublicKey;
|
|
1842
1844
|
voteAccount: PublicKey;
|
|
1843
1845
|
};
|
|
1844
1846
|
type ClaimAllProps = {
|
|
@@ -2091,6 +2093,8 @@ declare class JBondClient {
|
|
|
2091
2093
|
* Build start crowdfunding session instruction
|
|
2092
2094
|
*/
|
|
2093
2095
|
getBondSessionStartIx(props: BondStartProps): Promise<TransactionInstruction>;
|
|
2096
|
+
lockFunds(props: BondLockFunds): Promise<string | undefined>;
|
|
2097
|
+
releaseFunds(props: BondReleaseFunds): Promise<string | undefined>;
|
|
2094
2098
|
/**
|
|
2095
2099
|
* Build lock funds instruction
|
|
2096
2100
|
*/
|
package/dist/index.js
CHANGED
|
@@ -7079,11 +7079,19 @@ var JBondClient = class _JBondClient {
|
|
|
7079
7079
|
const authority = this.provider.wallet?.publicKey;
|
|
7080
7080
|
return this.program.methods.sessionStart(new import_bn.BN(props.duration)).accountsPartial({ bondState, authority }).instruction();
|
|
7081
7081
|
}
|
|
7082
|
+
async lockFunds(props) {
|
|
7083
|
+
const ix = await this.getLockFundsIx(props);
|
|
7084
|
+
return this.provider.sendAndConfirm?.(new web3_js.Transaction().add(ix));
|
|
7085
|
+
}
|
|
7086
|
+
async releaseFunds(props) {
|
|
7087
|
+
const ix = await this.getReleaseFundsIx(props);
|
|
7088
|
+
return this.provider.sendAndConfirm?.(new web3_js.Transaction().add(ix));
|
|
7089
|
+
}
|
|
7082
7090
|
/**
|
|
7083
7091
|
* Build lock funds instruction
|
|
7084
7092
|
*/
|
|
7085
7093
|
async getLockFundsIx(props) {
|
|
7086
|
-
const { bondType, name, voteAccount, amount } = props;
|
|
7094
|
+
const { bondType, name, voteAccount, amount, withdrawAuthority } = props;
|
|
7087
7095
|
const [bondState] = this.pda.bondState(bondType, name);
|
|
7088
7096
|
let collateralType = props.collateralType;
|
|
7089
7097
|
if (!collateralType) {
|
|
@@ -7091,11 +7099,10 @@ var JBondClient = class _JBondClient {
|
|
|
7091
7099
|
collateralType = bondState2.collateralType;
|
|
7092
7100
|
}
|
|
7093
7101
|
const [validatorBond] = this.pda.validatorBond(bondType, name, voteAccount);
|
|
7094
|
-
const authority = this.provider.wallet?.publicKey;
|
|
7095
7102
|
const accounts = {
|
|
7096
7103
|
bondState,
|
|
7097
7104
|
validatorBond,
|
|
7098
|
-
payer:
|
|
7105
|
+
payer: withdrawAuthority,
|
|
7099
7106
|
bondTokenAccount: null
|
|
7100
7107
|
};
|
|
7101
7108
|
matchVariant(collateralType, {
|
|
@@ -7112,12 +7119,11 @@ var JBondClient = class _JBondClient {
|
|
|
7112
7119
|
* Build release funds instruction
|
|
7113
7120
|
*/
|
|
7114
7121
|
async getReleaseFundsIx(props) {
|
|
7115
|
-
const { bondType, name, voteAccount, amount } = props;
|
|
7122
|
+
const { bondType, name, voteAccount, amount, withdrawAuthority } = props;
|
|
7116
7123
|
const [validatorBond] = this.pda.validatorBond(bondType, name, voteAccount);
|
|
7117
|
-
const authority = this.provider.wallet?.publicKey;
|
|
7118
7124
|
const accounts = {
|
|
7119
7125
|
validatorBond,
|
|
7120
|
-
payer:
|
|
7126
|
+
payer: withdrawAuthority
|
|
7121
7127
|
};
|
|
7122
7128
|
return this.program.methods.bondReleaseFunds(solToLamports(amount)).accountsPartial(accounts).instruction();
|
|
7123
7129
|
}
|