@wireio/stake 2.4.2 → 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 +13 -11
- package/lib/stake.browser.js.map +1 -1
- package/lib/stake.d.ts +6 -6
- package/lib/stake.js +13 -11
- package/lib/stake.js.map +1 -1
- package/lib/stake.m.js +13 -11
- package/lib/stake.m.js.map +1 -1
- package/package.json +1 -1
- package/src/networks/ethereum/ethereum.ts +5 -6
- package/src/networks/solana/clients/convert.client.ts +5 -3
- package/src/networks/solana/solana.ts +6 -4
- package/src/types.ts +2 -2
package/lib/stake.d.ts
CHANGED
|
@@ -44,9 +44,9 @@ interface IStakingClient {
|
|
|
44
44
|
/** Solana only: claim accrued liqSOL distribution rewards. */
|
|
45
45
|
claimLiqsolRewards?(): Promise<string>;
|
|
46
46
|
/** Enumerate withdrawal receipt NFTs held by the user (queued/ready/claimed). */
|
|
47
|
-
getPendingWithdraws(): Promise<WithdrawReceipt$1[]>;
|
|
47
|
+
getPendingWithdraws(address?: string): Promise<WithdrawReceipt$1[]>;
|
|
48
48
|
/** Fetch the complete user portfolio */
|
|
49
|
-
getPortfolio(): Promise<Portfolio | null>;
|
|
49
|
+
getPortfolio(address?: string): Promise<Portfolio | null>;
|
|
50
50
|
getSystemAPY(): Promise<number>;
|
|
51
51
|
/**
|
|
52
52
|
* Program-level prelaunch WIRE/tranche snapshot for this chain.
|
|
@@ -472,7 +472,7 @@ declare class EthereumStakingClient implements IStakingClient {
|
|
|
472
472
|
* @param amount Amount in wei (or something convertible to BigNumber).
|
|
473
473
|
* @returns transaction hash
|
|
474
474
|
*/
|
|
475
|
-
getPendingWithdraws(): Promise<WithdrawReceipt[]>;
|
|
475
|
+
getPendingWithdraws(address?: string): Promise<WithdrawReceipt[]>;
|
|
476
476
|
/**
|
|
477
477
|
* Withdraw native ETH from the liqETH protocol via the liqeth safeBurn function, which burns the LiqETH and adds the user to the withdrawal queue.
|
|
478
478
|
* @param tokenId The ID of the withdrawal request NFT
|
|
@@ -505,7 +505,7 @@ declare class EthereumStakingClient implements IStakingClient {
|
|
|
505
505
|
* actual = liqETH token balance (ERC-20)
|
|
506
506
|
* tracked = liqETH tracked balance (protocol/accounting view)
|
|
507
507
|
*/
|
|
508
|
-
getPortfolio(): Promise<Portfolio | null>;
|
|
508
|
+
getPortfolio(address?: string): Promise<Portfolio | null>;
|
|
509
509
|
/**
|
|
510
510
|
* ETH Prelaunch function to list the Stake ReceiptNFTs owned by a specific user
|
|
511
511
|
* @param address address to query the receipts for
|
|
@@ -16835,7 +16835,7 @@ declare class SolanaStakingClient implements IStakingClient {
|
|
|
16835
16835
|
* Enumerate withdrawal receipt NFTs held by the user (queued/ready/claimed).
|
|
16836
16836
|
* Mirrors the ETH getPendingWithdraws helper for UI parity.
|
|
16837
16837
|
*/
|
|
16838
|
-
getPendingWithdraws(address?:
|
|
16838
|
+
getPendingWithdraws(address?: string): Promise<WithdrawReceipt$1[]>;
|
|
16839
16839
|
/**
|
|
16840
16840
|
* Claim a withdrawal receipt (burn NFT + receive SOL) via claim_withdraw.
|
|
16841
16841
|
*/
|
|
@@ -16868,7 +16868,7 @@ declare class SolanaStakingClient implements IStakingClient {
|
|
|
16868
16868
|
* - yield: on-chain index/shares plus an estimated accrued liqSOL yield
|
|
16869
16869
|
* - extras: useful internal addresses and raw state for debugging/UX
|
|
16870
16870
|
*/
|
|
16871
|
-
getPortfolio(): Promise<Portfolio>;
|
|
16871
|
+
getPortfolio(address?: string): Promise<Portfolio>;
|
|
16872
16872
|
/**
|
|
16873
16873
|
* Convenience helper to fetch the distribution userRecord for the current user.
|
|
16874
16874
|
* Used by balance-correction flows and debugging.
|
package/lib/stake.js
CHANGED
|
@@ -16169,10 +16169,12 @@ let ConvertClient$1 = class ConvertClient {
|
|
|
16169
16169
|
}
|
|
16170
16170
|
let slotTimeSec = 0.4;
|
|
16171
16171
|
try {
|
|
16172
|
-
const samples = yield conn.getRecentPerformanceSamples(
|
|
16172
|
+
const samples = yield conn.getRecentPerformanceSamples(60);
|
|
16173
16173
|
if (samples == null ? void 0 : samples.length) {
|
|
16174
|
-
const
|
|
16175
|
-
|
|
16174
|
+
const valid = samples.filter((s) => s.numSlots > 0);
|
|
16175
|
+
if (valid.length) {
|
|
16176
|
+
slotTimeSec = valid.reduce((sum, s) => sum + s.samplePeriodSecs / s.numSlots, 0) / valid.length;
|
|
16177
|
+
}
|
|
16176
16178
|
}
|
|
16177
16179
|
} catch (_) {
|
|
16178
16180
|
}
|
|
@@ -17308,7 +17310,7 @@ const _SolanaStakingClient = class _SolanaStakingClient {
|
|
|
17308
17310
|
return __async$9(this, null, function* () {
|
|
17309
17311
|
var _a;
|
|
17310
17312
|
this.ensureUser();
|
|
17311
|
-
const owner =
|
|
17313
|
+
const owner = address ? new web3_js.PublicKey(address) : (_a = this.squadsVaultPDA) != null ? _a : this.anchor.wallet.publicKey;
|
|
17312
17314
|
return yield this.convertClient.fetchWithdrawReceipts(owner);
|
|
17313
17315
|
});
|
|
17314
17316
|
}
|
|
@@ -17382,11 +17384,11 @@ const _SolanaStakingClient = class _SolanaStakingClient {
|
|
|
17382
17384
|
}
|
|
17383
17385
|
});
|
|
17384
17386
|
}
|
|
17385
|
-
getPortfolio() {
|
|
17387
|
+
getPortfolio(address) {
|
|
17386
17388
|
return __async$9(this, null, function* () {
|
|
17387
17389
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
17388
17390
|
try {
|
|
17389
|
-
const user = !!this.squadsX ? this.squadsVaultPDA : this.solPubKey;
|
|
17391
|
+
const user = address ? new web3_js.PublicKey(address) : !!this.squadsX ? this.squadsVaultPDA : this.solPubKey;
|
|
17390
17392
|
const reservePoolPDA = this.program.deriveReservePoolPda();
|
|
17391
17393
|
const vaultPDA = this.program.deriveVaultPda();
|
|
17392
17394
|
const liqsolMint = this.program.deriveLiqsolMintPda();
|
|
@@ -43312,11 +43314,11 @@ class EthereumStakingClient {
|
|
|
43312
43314
|
return result.txHash;
|
|
43313
43315
|
});
|
|
43314
43316
|
}
|
|
43315
|
-
getPendingWithdraws() {
|
|
43317
|
+
getPendingWithdraws(address) {
|
|
43316
43318
|
return __async(this, null, function* () {
|
|
43317
43319
|
this.ensureUser();
|
|
43318
|
-
const
|
|
43319
|
-
return yield this.receiptClient.fetchWithdrawReceipts(
|
|
43320
|
+
const owner = address != null ? address : yield this.address;
|
|
43321
|
+
return yield this.receiptClient.fetchWithdrawReceipts(owner);
|
|
43320
43322
|
});
|
|
43321
43323
|
}
|
|
43322
43324
|
claimWithdraw(tokenId) {
|
|
@@ -43364,12 +43366,12 @@ class EthereumStakingClient {
|
|
|
43364
43366
|
return result && result.txHash ? result.txHash : "Error - no resulting txHash";
|
|
43365
43367
|
});
|
|
43366
43368
|
}
|
|
43367
|
-
getPortfolio() {
|
|
43369
|
+
getPortfolio(address) {
|
|
43368
43370
|
return __async(this, null, function* () {
|
|
43369
43371
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
43370
43372
|
try {
|
|
43371
43373
|
if (!this.signer) return Promise.resolve(null);
|
|
43372
|
-
const walletAddress = yield this.address;
|
|
43374
|
+
const walletAddress = address != null ? address : yield this.address;
|
|
43373
43375
|
const nativeBalance = yield this.provider.getBalance(walletAddress);
|
|
43374
43376
|
const nativeDecimals = (_c = (_b = (_a = this.network) == null ? void 0 : _a.nativeCurrency) == null ? void 0 : _b.decimals) != null ? _c : 18;
|
|
43375
43377
|
const nativeSymbol = (_f = (_e = (_d = this.network) == null ? void 0 : _d.nativeCurrency) == null ? void 0 : _e.symbol) != null ? _f : "ETH";
|