@jpool/bond-sdk 0.9.0-next.6 → 0.9.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 +19 -36
- package/dist/index.d.ts +19 -36
- package/dist/index.js +409 -657
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +412 -651
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Fee } from '@solana/spl-stake-pool/src/layouts';
|
|
2
|
-
import * as _solana_web3_js from '@solana/web3.js';
|
|
3
2
|
import { PublicKey, TransactionInstruction, Connection, PublicKeyInitData, Transaction, VersionedTransaction, Keypair } from '@solana/web3.js';
|
|
4
3
|
import BN from 'bn.js';
|
|
5
4
|
import { IdlTypes, IdlAccounts, Program, Provider } from '@coral-xyz/anchor';
|
|
@@ -1535,7 +1534,7 @@ type BondType = IdlTypes<Jbond>['bondType'];
|
|
|
1535
1534
|
type CollateralType = IdlTypes<Jbond>['collateralType'];
|
|
1536
1535
|
type BondStateStats = {
|
|
1537
1536
|
totalCollected: number;
|
|
1538
|
-
|
|
1537
|
+
status: SessionStatus;
|
|
1539
1538
|
};
|
|
1540
1539
|
declare const bondTypeToSeed: {
|
|
1541
1540
|
performance: Seeds;
|
|
@@ -1565,6 +1564,7 @@ type RegisterValidatorProps = {
|
|
|
1565
1564
|
type TopUpCollateralProps = {
|
|
1566
1565
|
bondType: BondType;
|
|
1567
1566
|
name: string;
|
|
1567
|
+
identity: PublicKey;
|
|
1568
1568
|
voteAccount: PublicKey;
|
|
1569
1569
|
collateral: BondCollateral;
|
|
1570
1570
|
payer?: PublicKey;
|
|
@@ -1723,7 +1723,6 @@ declare class JBondClient {
|
|
|
1723
1723
|
* Configure a specific option.
|
|
1724
1724
|
*/
|
|
1725
1725
|
configureEnv<K extends keyof ClientOptions>(key: K, val: ClientOptions[K]): this;
|
|
1726
|
-
private getAdapter;
|
|
1727
1726
|
private getBondTypeSeed;
|
|
1728
1727
|
/**
|
|
1729
1728
|
* Program Derived Addresses (PDAs)
|
|
@@ -1792,48 +1791,30 @@ declare class JBondClient {
|
|
|
1792
1791
|
bondType: BondType;
|
|
1793
1792
|
name: string;
|
|
1794
1793
|
}): Promise<string | undefined>;
|
|
1795
|
-
|
|
1794
|
+
buildBondGlobalStateInitializeIx(props: GlobalInitializeProps): Promise<TransactionInstruction>;
|
|
1796
1795
|
/**
|
|
1797
1796
|
* Build configure instruction
|
|
1798
1797
|
*/
|
|
1799
|
-
buildGlobalConfigureInstruction(props: GlobalConfigureProps): Promise<
|
|
1798
|
+
buildGlobalConfigureInstruction(props: GlobalConfigureProps): Promise<TransactionInstruction>;
|
|
1800
1799
|
/**
|
|
1801
1800
|
* Build initialize instruction
|
|
1802
1801
|
*/
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
buildTopUpCollateralInstruction(props: TopUpCollateralProps): Promise<_solana_web3_js.TransactionInstruction>;
|
|
1812
|
-
/**
|
|
1813
|
-
* Build withdraw collateral instruction
|
|
1814
|
-
*/
|
|
1815
|
-
buildWithdrawCollateralInstruction(props: WithdrawCollateralProps): Promise<_solana_web3_js.TransactionInstruction>;
|
|
1816
|
-
/**
|
|
1817
|
-
* Build claim compensation instruction
|
|
1818
|
-
*/
|
|
1819
|
-
buildBondClaimInstruction(props: ClaimProps): Promise<_solana_web3_js.TransactionInstruction>;
|
|
1820
|
-
/**
|
|
1821
|
-
* Build configure instruction
|
|
1822
|
-
*/
|
|
1823
|
-
buildConfigureInstruction(props: BondConfigureProps): Promise<_solana_web3_js.TransactionInstruction>;
|
|
1824
|
-
/**
|
|
1825
|
-
* Build set withdraw authority instruction
|
|
1826
|
-
*/
|
|
1827
|
-
buildSetWithdrawAuthorityInstruction(props: SetWithdrawAuthorityProps): Promise<_solana_web3_js.TransactionInstruction>;
|
|
1828
|
-
buildBondStartInstruction(props: {
|
|
1802
|
+
buildBondInitializeIx(props: BondInitializeProps): Promise<TransactionInstruction>;
|
|
1803
|
+
buildConfigureIx(props: BondConfigureProps): Promise<TransactionInstruction>;
|
|
1804
|
+
buildRegisterIx(props: RegisterValidatorProps): Promise<TransactionInstruction>;
|
|
1805
|
+
buildTopUpIXs(props: TopUpCollateralProps): Promise<TransactionInstruction[]>;
|
|
1806
|
+
buildWithdrawIx(props: WithdrawCollateralProps): Promise<TransactionInstruction>;
|
|
1807
|
+
buildClaimIx(props: ClaimProps): Promise<TransactionInstruction>;
|
|
1808
|
+
buildSetWithdrawAuthorityIx(props: SetWithdrawAuthorityProps): Promise<TransactionInstruction>;
|
|
1809
|
+
buildBondFinishIx(_props: {
|
|
1829
1810
|
bondType: BondType;
|
|
1830
1811
|
name: string;
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
buildBondFinishInstruction(props: {
|
|
1812
|
+
}): Promise<TransactionInstruction>;
|
|
1813
|
+
buildBondStartIx(props: {
|
|
1834
1814
|
bondType: BondType;
|
|
1835
1815
|
name: string;
|
|
1836
|
-
|
|
1816
|
+
duration_secs: number;
|
|
1817
|
+
}): Promise<TransactionInstruction>;
|
|
1837
1818
|
/**
|
|
1838
1819
|
* Fetch global state or throw if not found
|
|
1839
1820
|
*/
|
|
@@ -1842,7 +1823,8 @@ declare class JBondClient {
|
|
|
1842
1823
|
/**
|
|
1843
1824
|
* Get all bond states with total collected collateral
|
|
1844
1825
|
*/
|
|
1845
|
-
getAllBondStates(_bondType: BondType): Promise<Array<[BondState,
|
|
1826
|
+
getAllBondStates(_bondType: BondType): Promise<Array<[BondState, BondStateStats]>>;
|
|
1827
|
+
private getBondStateSessionStatus;
|
|
1846
1828
|
private getValidatorBondsByState;
|
|
1847
1829
|
/**
|
|
1848
1830
|
* Fetch validator bond data or null if not found
|
|
@@ -1880,6 +1862,7 @@ declare class JBondClient {
|
|
|
1880
1862
|
* Throws an error if no user is available.
|
|
1881
1863
|
*/
|
|
1882
1864
|
private ensureUser;
|
|
1865
|
+
private lamports;
|
|
1883
1866
|
}
|
|
1884
1867
|
|
|
1885
1868
|
export { BondClientEnv, type BondCollateral, type BondConfigureProps, type BondInitializeProps, type BondState, type BondStateStats, BondTransactionType, type BondType, BondTypeVariant, type ClaimProps, type ClientOptions, type CollateralType, ENV_PROGRAM_ID, type EpochHistoryItem, type GetHistoryGroupedProps, type GetHistoryProps, type GlobalConfigureProps, type GlobalInitializeProps, type GlobalState, JBondClient, JPOOL_STAKE_POOL, type Jbond, NodeWallet, type RegisterValidatorProps, Seeds, SessionStatus, type SetWithdrawAuthorityProps, type TopUpCollateralProps, type TransactionHistoryItem, type ValidatorBond, type WithdrawCollateralProps, bondTypeToSeed };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Fee } from '@solana/spl-stake-pool/src/layouts';
|
|
2
|
-
import * as _solana_web3_js from '@solana/web3.js';
|
|
3
2
|
import { PublicKey, TransactionInstruction, Connection, PublicKeyInitData, Transaction, VersionedTransaction, Keypair } from '@solana/web3.js';
|
|
4
3
|
import BN from 'bn.js';
|
|
5
4
|
import { IdlTypes, IdlAccounts, Program, Provider } from '@coral-xyz/anchor';
|
|
@@ -1535,7 +1534,7 @@ type BondType = IdlTypes<Jbond>['bondType'];
|
|
|
1535
1534
|
type CollateralType = IdlTypes<Jbond>['collateralType'];
|
|
1536
1535
|
type BondStateStats = {
|
|
1537
1536
|
totalCollected: number;
|
|
1538
|
-
|
|
1537
|
+
status: SessionStatus;
|
|
1539
1538
|
};
|
|
1540
1539
|
declare const bondTypeToSeed: {
|
|
1541
1540
|
performance: Seeds;
|
|
@@ -1565,6 +1564,7 @@ type RegisterValidatorProps = {
|
|
|
1565
1564
|
type TopUpCollateralProps = {
|
|
1566
1565
|
bondType: BondType;
|
|
1567
1566
|
name: string;
|
|
1567
|
+
identity: PublicKey;
|
|
1568
1568
|
voteAccount: PublicKey;
|
|
1569
1569
|
collateral: BondCollateral;
|
|
1570
1570
|
payer?: PublicKey;
|
|
@@ -1723,7 +1723,6 @@ declare class JBondClient {
|
|
|
1723
1723
|
* Configure a specific option.
|
|
1724
1724
|
*/
|
|
1725
1725
|
configureEnv<K extends keyof ClientOptions>(key: K, val: ClientOptions[K]): this;
|
|
1726
|
-
private getAdapter;
|
|
1727
1726
|
private getBondTypeSeed;
|
|
1728
1727
|
/**
|
|
1729
1728
|
* Program Derived Addresses (PDAs)
|
|
@@ -1792,48 +1791,30 @@ declare class JBondClient {
|
|
|
1792
1791
|
bondType: BondType;
|
|
1793
1792
|
name: string;
|
|
1794
1793
|
}): Promise<string | undefined>;
|
|
1795
|
-
|
|
1794
|
+
buildBondGlobalStateInitializeIx(props: GlobalInitializeProps): Promise<TransactionInstruction>;
|
|
1796
1795
|
/**
|
|
1797
1796
|
* Build configure instruction
|
|
1798
1797
|
*/
|
|
1799
|
-
buildGlobalConfigureInstruction(props: GlobalConfigureProps): Promise<
|
|
1798
|
+
buildGlobalConfigureInstruction(props: GlobalConfigureProps): Promise<TransactionInstruction>;
|
|
1800
1799
|
/**
|
|
1801
1800
|
* Build initialize instruction
|
|
1802
1801
|
*/
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
buildTopUpCollateralInstruction(props: TopUpCollateralProps): Promise<_solana_web3_js.TransactionInstruction>;
|
|
1812
|
-
/**
|
|
1813
|
-
* Build withdraw collateral instruction
|
|
1814
|
-
*/
|
|
1815
|
-
buildWithdrawCollateralInstruction(props: WithdrawCollateralProps): Promise<_solana_web3_js.TransactionInstruction>;
|
|
1816
|
-
/**
|
|
1817
|
-
* Build claim compensation instruction
|
|
1818
|
-
*/
|
|
1819
|
-
buildBondClaimInstruction(props: ClaimProps): Promise<_solana_web3_js.TransactionInstruction>;
|
|
1820
|
-
/**
|
|
1821
|
-
* Build configure instruction
|
|
1822
|
-
*/
|
|
1823
|
-
buildConfigureInstruction(props: BondConfigureProps): Promise<_solana_web3_js.TransactionInstruction>;
|
|
1824
|
-
/**
|
|
1825
|
-
* Build set withdraw authority instruction
|
|
1826
|
-
*/
|
|
1827
|
-
buildSetWithdrawAuthorityInstruction(props: SetWithdrawAuthorityProps): Promise<_solana_web3_js.TransactionInstruction>;
|
|
1828
|
-
buildBondStartInstruction(props: {
|
|
1802
|
+
buildBondInitializeIx(props: BondInitializeProps): Promise<TransactionInstruction>;
|
|
1803
|
+
buildConfigureIx(props: BondConfigureProps): Promise<TransactionInstruction>;
|
|
1804
|
+
buildRegisterIx(props: RegisterValidatorProps): Promise<TransactionInstruction>;
|
|
1805
|
+
buildTopUpIXs(props: TopUpCollateralProps): Promise<TransactionInstruction[]>;
|
|
1806
|
+
buildWithdrawIx(props: WithdrawCollateralProps): Promise<TransactionInstruction>;
|
|
1807
|
+
buildClaimIx(props: ClaimProps): Promise<TransactionInstruction>;
|
|
1808
|
+
buildSetWithdrawAuthorityIx(props: SetWithdrawAuthorityProps): Promise<TransactionInstruction>;
|
|
1809
|
+
buildBondFinishIx(_props: {
|
|
1829
1810
|
bondType: BondType;
|
|
1830
1811
|
name: string;
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
buildBondFinishInstruction(props: {
|
|
1812
|
+
}): Promise<TransactionInstruction>;
|
|
1813
|
+
buildBondStartIx(props: {
|
|
1834
1814
|
bondType: BondType;
|
|
1835
1815
|
name: string;
|
|
1836
|
-
|
|
1816
|
+
duration_secs: number;
|
|
1817
|
+
}): Promise<TransactionInstruction>;
|
|
1837
1818
|
/**
|
|
1838
1819
|
* Fetch global state or throw if not found
|
|
1839
1820
|
*/
|
|
@@ -1842,7 +1823,8 @@ declare class JBondClient {
|
|
|
1842
1823
|
/**
|
|
1843
1824
|
* Get all bond states with total collected collateral
|
|
1844
1825
|
*/
|
|
1845
|
-
getAllBondStates(_bondType: BondType): Promise<Array<[BondState,
|
|
1826
|
+
getAllBondStates(_bondType: BondType): Promise<Array<[BondState, BondStateStats]>>;
|
|
1827
|
+
private getBondStateSessionStatus;
|
|
1846
1828
|
private getValidatorBondsByState;
|
|
1847
1829
|
/**
|
|
1848
1830
|
* Fetch validator bond data or null if not found
|
|
@@ -1880,6 +1862,7 @@ declare class JBondClient {
|
|
|
1880
1862
|
* Throws an error if no user is available.
|
|
1881
1863
|
*/
|
|
1882
1864
|
private ensureUser;
|
|
1865
|
+
private lamports;
|
|
1883
1866
|
}
|
|
1884
1867
|
|
|
1885
1868
|
export { BondClientEnv, type BondCollateral, type BondConfigureProps, type BondInitializeProps, type BondState, type BondStateStats, BondTransactionType, type BondType, BondTypeVariant, type ClaimProps, type ClientOptions, type CollateralType, ENV_PROGRAM_ID, type EpochHistoryItem, type GetHistoryGroupedProps, type GetHistoryProps, type GlobalConfigureProps, type GlobalInitializeProps, type GlobalState, JBondClient, JPOOL_STAKE_POOL, type Jbond, NodeWallet, type RegisterValidatorProps, Seeds, SessionStatus, type SetWithdrawAuthorityProps, type TopUpCollateralProps, type TransactionHistoryItem, type ValidatorBond, type WithdrawCollateralProps, bondTypeToSeed };
|