@jpool/bond-sdk 0.9.0-next.4 → 0.9.0-next.5
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 +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -7003,6 +7003,15 @@ var JBondClient = class _JBondClient {
|
|
|
7003
7003
|
const [bondState] = this.pda.bondState(bondType, bondName);
|
|
7004
7004
|
return await this.program.account.bondState.fetch(bondState);
|
|
7005
7005
|
}
|
|
7006
|
+
/// Fetch all bond states by type
|
|
7007
|
+
async getAllBondStates(_bondType) {
|
|
7008
|
+
const bondStates = [];
|
|
7009
|
+
const bondStateAccounts = await this.program.account.bondState.all();
|
|
7010
|
+
for (const { account } of bondStateAccounts) {
|
|
7011
|
+
bondStates.push(account);
|
|
7012
|
+
}
|
|
7013
|
+
return bondStates;
|
|
7014
|
+
}
|
|
7006
7015
|
async getBondStateSessionStatus(bondType, bondName) {
|
|
7007
7016
|
const bondState = await this.getBondState(bondType, bondName);
|
|
7008
7017
|
const now = Math.floor(Date.now() / 1e3);
|