@wireio/stake 2.4.3 → 2.4.4
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/lib/stake.browser.js +9 -7
- package/lib/stake.browser.js.map +1 -1
- package/lib/stake.d.ts +3 -3
- package/lib/stake.js +9 -7
- package/lib/stake.js.map +1 -1
- package/lib/stake.m.js +9 -7
- package/lib/stake.m.js.map +1 -1
- package/package.json +1 -1
- package/src/networks/ethereum/ethereum.ts +2 -2
- package/src/networks/solana/clients/convert.client.ts +5 -3
- package/src/networks/solana/solana.ts +3 -2
- package/src/types.ts +1 -1
package/lib/stake.browser.js
CHANGED
|
@@ -16062,10 +16062,12 @@ let ConvertClient$1 = class ConvertClient {
|
|
|
16062
16062
|
}
|
|
16063
16063
|
let slotTimeSec = 0.4;
|
|
16064
16064
|
try {
|
|
16065
|
-
const samples = await conn.getRecentPerformanceSamples(
|
|
16065
|
+
const samples = await conn.getRecentPerformanceSamples(60);
|
|
16066
16066
|
if (samples?.length) {
|
|
16067
|
-
const
|
|
16068
|
-
|
|
16067
|
+
const valid = samples.filter((s) => s.numSlots > 0);
|
|
16068
|
+
if (valid.length) {
|
|
16069
|
+
slotTimeSec = valid.reduce((sum, s) => sum + s.samplePeriodSecs / s.numSlots, 0) / valid.length;
|
|
16070
|
+
}
|
|
16069
16071
|
}
|
|
16070
16072
|
} catch (_) {
|
|
16071
16073
|
}
|
|
@@ -17051,9 +17053,9 @@ const _SolanaStakingClient = class _SolanaStakingClient {
|
|
|
17051
17053
|
throw err;
|
|
17052
17054
|
}
|
|
17053
17055
|
}
|
|
17054
|
-
async getPortfolio() {
|
|
17056
|
+
async getPortfolio(address) {
|
|
17055
17057
|
try {
|
|
17056
|
-
const user = !!this.squadsX ? this.squadsVaultPDA : this.solPubKey;
|
|
17058
|
+
const user = address ? new PublicKey(address) : !!this.squadsX ? this.squadsVaultPDA : this.solPubKey;
|
|
17057
17059
|
const reservePoolPDA = this.program.deriveReservePoolPda();
|
|
17058
17060
|
const vaultPDA = this.program.deriveVaultPda();
|
|
17059
17061
|
const liqsolMint = this.program.deriveLiqsolMintPda();
|
|
@@ -42738,10 +42740,10 @@ class EthereumStakingClient {
|
|
|
42738
42740
|
let result = await this.validatorClient.validatorDepositAndLockBond();
|
|
42739
42741
|
return result && result.txHash ? result.txHash : "Error - no resulting txHash";
|
|
42740
42742
|
}
|
|
42741
|
-
async getPortfolio() {
|
|
42743
|
+
async getPortfolio(address) {
|
|
42742
42744
|
try {
|
|
42743
42745
|
if (!this.signer) return Promise.resolve(null);
|
|
42744
|
-
const walletAddress = await this.address;
|
|
42746
|
+
const walletAddress = address ?? await this.address;
|
|
42745
42747
|
const nativeBalance = await this.provider.getBalance(walletAddress);
|
|
42746
42748
|
const nativeDecimals = this.network?.nativeCurrency?.decimals ?? 18;
|
|
42747
42749
|
const nativeSymbol = this.network?.nativeCurrency?.symbol ?? "ETH";
|