@jpool/bond-sdk 0.9.0-next.22 → 0.9.0-next.24
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 +10 -9
- package/dist/index.d.ts +10 -9
- package/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -17,7 +17,7 @@ declare enum Seeds {
|
|
|
17
17
|
GlobalState = "global_state",
|
|
18
18
|
BondState = "bond_state",
|
|
19
19
|
ValidatorBond = "validator_bond",
|
|
20
|
-
|
|
20
|
+
StandardBond = "standard",
|
|
21
21
|
CrowdFundingBond = "crowdfunding"
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
@@ -32,7 +32,7 @@ declare const ENV_PROGRAM_ID: Record<string, PublicKey>;
|
|
|
32
32
|
* IDL can be found at `target/idl/jbond.json`.
|
|
33
33
|
*/
|
|
34
34
|
type Jbond = {
|
|
35
|
-
"address": "
|
|
35
|
+
"address": "BondQ7KqZreTcW2UbeTNDcLCJQ3aXAtLn2Fm6ftaJDU";
|
|
36
36
|
"metadata": {
|
|
37
37
|
"name": "jbond";
|
|
38
38
|
"version": "0.2.1";
|
|
@@ -1295,7 +1295,7 @@ type Jbond = {
|
|
|
1295
1295
|
{
|
|
1296
1296
|
"name": "bondType";
|
|
1297
1297
|
"docs": [
|
|
1298
|
-
"The type of bond (e.g.,
|
|
1298
|
+
"The type of bond (e.g., Standard, Crowdfunding)"
|
|
1299
1299
|
];
|
|
1300
1300
|
"type": {
|
|
1301
1301
|
"defined": {
|
|
@@ -1407,7 +1407,7 @@ type Jbond = {
|
|
|
1407
1407
|
"kind": "enum";
|
|
1408
1408
|
"variants": [
|
|
1409
1409
|
{
|
|
1410
|
-
"name": "
|
|
1410
|
+
"name": "standard";
|
|
1411
1411
|
},
|
|
1412
1412
|
{
|
|
1413
1413
|
"name": "crowdfunding";
|
|
@@ -1632,11 +1632,11 @@ type BondStateStats = {
|
|
|
1632
1632
|
status: SessionStatus;
|
|
1633
1633
|
};
|
|
1634
1634
|
declare const bondTypeToSeed: {
|
|
1635
|
-
|
|
1635
|
+
standard: Seeds;
|
|
1636
1636
|
crowdfunding: Seeds;
|
|
1637
1637
|
};
|
|
1638
1638
|
declare const BondTypeVariant: {
|
|
1639
|
-
|
|
1639
|
+
Standard: BondType;
|
|
1640
1640
|
Crowdfunding: BondType;
|
|
1641
1641
|
};
|
|
1642
1642
|
declare const BondStateStatusVariant: {
|
|
@@ -1942,15 +1942,16 @@ declare class JBondClient {
|
|
|
1942
1942
|
/**
|
|
1943
1943
|
* Get all bond states with total collected collateral
|
|
1944
1944
|
*/
|
|
1945
|
-
getAllBondStates(bondType: BondType,
|
|
1945
|
+
getAllBondStates(bondType: BondType, sessionStatus?: SessionStatus): Promise<{
|
|
1946
|
+
publicKey: PublicKey;
|
|
1946
1947
|
bondState: {
|
|
1947
1948
|
name: string;
|
|
1948
1949
|
bondType: ({
|
|
1949
1950
|
crowdfunding?: undefined;
|
|
1950
1951
|
} & {
|
|
1951
|
-
|
|
1952
|
+
standard: Record<string, never>;
|
|
1952
1953
|
}) | ({
|
|
1953
|
-
|
|
1954
|
+
standard?: undefined;
|
|
1954
1955
|
} & {
|
|
1955
1956
|
crowdfunding: Record<string, never>;
|
|
1956
1957
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ declare enum Seeds {
|
|
|
17
17
|
GlobalState = "global_state",
|
|
18
18
|
BondState = "bond_state",
|
|
19
19
|
ValidatorBond = "validator_bond",
|
|
20
|
-
|
|
20
|
+
StandardBond = "standard",
|
|
21
21
|
CrowdFundingBond = "crowdfunding"
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
@@ -32,7 +32,7 @@ declare const ENV_PROGRAM_ID: Record<string, PublicKey>;
|
|
|
32
32
|
* IDL can be found at `target/idl/jbond.json`.
|
|
33
33
|
*/
|
|
34
34
|
type Jbond = {
|
|
35
|
-
"address": "
|
|
35
|
+
"address": "BondQ7KqZreTcW2UbeTNDcLCJQ3aXAtLn2Fm6ftaJDU";
|
|
36
36
|
"metadata": {
|
|
37
37
|
"name": "jbond";
|
|
38
38
|
"version": "0.2.1";
|
|
@@ -1295,7 +1295,7 @@ type Jbond = {
|
|
|
1295
1295
|
{
|
|
1296
1296
|
"name": "bondType";
|
|
1297
1297
|
"docs": [
|
|
1298
|
-
"The type of bond (e.g.,
|
|
1298
|
+
"The type of bond (e.g., Standard, Crowdfunding)"
|
|
1299
1299
|
];
|
|
1300
1300
|
"type": {
|
|
1301
1301
|
"defined": {
|
|
@@ -1407,7 +1407,7 @@ type Jbond = {
|
|
|
1407
1407
|
"kind": "enum";
|
|
1408
1408
|
"variants": [
|
|
1409
1409
|
{
|
|
1410
|
-
"name": "
|
|
1410
|
+
"name": "standard";
|
|
1411
1411
|
},
|
|
1412
1412
|
{
|
|
1413
1413
|
"name": "crowdfunding";
|
|
@@ -1632,11 +1632,11 @@ type BondStateStats = {
|
|
|
1632
1632
|
status: SessionStatus;
|
|
1633
1633
|
};
|
|
1634
1634
|
declare const bondTypeToSeed: {
|
|
1635
|
-
|
|
1635
|
+
standard: Seeds;
|
|
1636
1636
|
crowdfunding: Seeds;
|
|
1637
1637
|
};
|
|
1638
1638
|
declare const BondTypeVariant: {
|
|
1639
|
-
|
|
1639
|
+
Standard: BondType;
|
|
1640
1640
|
Crowdfunding: BondType;
|
|
1641
1641
|
};
|
|
1642
1642
|
declare const BondStateStatusVariant: {
|
|
@@ -1942,15 +1942,16 @@ declare class JBondClient {
|
|
|
1942
1942
|
/**
|
|
1943
1943
|
* Get all bond states with total collected collateral
|
|
1944
1944
|
*/
|
|
1945
|
-
getAllBondStates(bondType: BondType,
|
|
1945
|
+
getAllBondStates(bondType: BondType, sessionStatus?: SessionStatus): Promise<{
|
|
1946
|
+
publicKey: PublicKey;
|
|
1946
1947
|
bondState: {
|
|
1947
1948
|
name: string;
|
|
1948
1949
|
bondType: ({
|
|
1949
1950
|
crowdfunding?: undefined;
|
|
1950
1951
|
} & {
|
|
1951
|
-
|
|
1952
|
+
standard: Record<string, never>;
|
|
1952
1953
|
}) | ({
|
|
1953
|
-
|
|
1954
|
+
standard?: undefined;
|
|
1954
1955
|
} & {
|
|
1955
1956
|
crowdfunding: Record<string, never>;
|
|
1956
1957
|
});
|
package/dist/index.js
CHANGED
|
@@ -4579,7 +4579,7 @@ var Seeds = /* @__PURE__ */ ((Seeds2) => {
|
|
|
4579
4579
|
Seeds2["GlobalState"] = "global_state";
|
|
4580
4580
|
Seeds2["BondState"] = "bond_state";
|
|
4581
4581
|
Seeds2["ValidatorBond"] = "validator_bond";
|
|
4582
|
-
Seeds2["
|
|
4582
|
+
Seeds2["StandardBond"] = "standard";
|
|
4583
4583
|
Seeds2["CrowdFundingBond"] = "crowdfunding";
|
|
4584
4584
|
return Seeds2;
|
|
4585
4585
|
})(Seeds || {});
|
|
@@ -4593,11 +4593,11 @@ init_cjs_shims();
|
|
|
4593
4593
|
// src/types/index.ts
|
|
4594
4594
|
init_cjs_shims();
|
|
4595
4595
|
var bondTypeToSeed = {
|
|
4596
|
-
|
|
4596
|
+
standard: "standard" /* StandardBond */,
|
|
4597
4597
|
crowdfunding: "crowdfunding" /* CrowdFundingBond */
|
|
4598
4598
|
};
|
|
4599
4599
|
var BondTypeVariant = {
|
|
4600
|
-
|
|
4600
|
+
Standard: { standard: {} },
|
|
4601
4601
|
Crowdfunding: { crowdfunding: {} }
|
|
4602
4602
|
};
|
|
4603
4603
|
var BondStateStatusVariant = {
|
|
@@ -4842,7 +4842,7 @@ var HistoryManager = class {
|
|
|
4842
4842
|
|
|
4843
4843
|
// src/idl/jbond.json
|
|
4844
4844
|
var jbond_default = {
|
|
4845
|
-
address: "
|
|
4845
|
+
address: "BondQ7KqZreTcW2UbeTNDcLCJQ3aXAtLn2Fm6ftaJDU",
|
|
4846
4846
|
metadata: {
|
|
4847
4847
|
name: "jbond",
|
|
4848
4848
|
version: "0.2.1",
|
|
@@ -6105,7 +6105,7 @@ var jbond_default = {
|
|
|
6105
6105
|
{
|
|
6106
6106
|
name: "bond_type",
|
|
6107
6107
|
docs: [
|
|
6108
|
-
"The type of bond (e.g.,
|
|
6108
|
+
"The type of bond (e.g., Standard, Crowdfunding)"
|
|
6109
6109
|
],
|
|
6110
6110
|
type: {
|
|
6111
6111
|
defined: {
|
|
@@ -6217,7 +6217,7 @@ var jbond_default = {
|
|
|
6217
6217
|
kind: "enum",
|
|
6218
6218
|
variants: [
|
|
6219
6219
|
{
|
|
6220
|
-
name: "
|
|
6220
|
+
name: "Standard"
|
|
6221
6221
|
},
|
|
6222
6222
|
{
|
|
6223
6223
|
name: "Crowdfunding"
|
|
@@ -6941,19 +6941,20 @@ var JBondClient = class _JBondClient {
|
|
|
6941
6941
|
/**
|
|
6942
6942
|
* Get all bond states with total collected collateral
|
|
6943
6943
|
*/
|
|
6944
|
-
async getAllBondStates(bondType,
|
|
6944
|
+
async getAllBondStates(bondType, sessionStatus) {
|
|
6945
6945
|
const bondStates = [];
|
|
6946
6946
|
const bondStateAccounts = await this.program.account.bondState.all();
|
|
6947
|
-
for (const { account: state } of bondStateAccounts) {
|
|
6947
|
+
for (const { publicKey, account: state } of bondStateAccounts) {
|
|
6948
6948
|
if (!sameVariant(state.bondType, bondType)) {
|
|
6949
6949
|
continue;
|
|
6950
6950
|
}
|
|
6951
|
-
if (
|
|
6951
|
+
if (sessionStatus !== void 0 && this.getBondStateSessionStatus(state) !== sessionStatus) {
|
|
6952
6952
|
continue;
|
|
6953
6953
|
}
|
|
6954
6954
|
const bondStateStats = await this.getBondStateStats(state);
|
|
6955
6955
|
bondStates.push(
|
|
6956
6956
|
{
|
|
6957
|
+
publicKey,
|
|
6957
6958
|
bondState: state,
|
|
6958
6959
|
stateStats: bondStateStats
|
|
6959
6960
|
}
|