@wireio/stake 0.3.0 → 0.3.1
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 +5 -5
- package/lib/stake.browser.js.map +1 -1
- package/lib/stake.d.ts +3 -4
- package/lib/stake.js +5 -5
- package/lib/stake.js.map +1 -1
- package/lib/stake.m.js +5 -5
- package/lib/stake.m.js.map +1 -1
- package/package.json +1 -1
- package/src/networks/ethereum/utils.ts +1 -1
- package/src/networks/solana/solana.ts +2 -1
- package/src/networks/solana/types.ts +2 -3
- package/src/networks/solana/utils.ts +5 -5
- package/src/types.ts +1 -1
package/package.json
CHANGED
|
@@ -300,7 +300,7 @@ export async function buildEthereumTrancheSnapshot(options: {
|
|
|
300
300
|
priceGrowthBps,
|
|
301
301
|
currentTrancheSupply,
|
|
302
302
|
initialTrancheSupply,
|
|
303
|
-
|
|
303
|
+
totalWarrantsSold: totalTrancheSupply,
|
|
304
304
|
nativePriceUsd: ethPriceUsd,
|
|
305
305
|
nativePriceTimestamp,
|
|
306
306
|
ladder,
|
|
@@ -281,7 +281,7 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
281
281
|
wireReceipt?.stakedLiqsol?.toString() ?? '0';
|
|
282
282
|
|
|
283
283
|
const wireSharesStr =
|
|
284
|
-
userWarrantRecord?.
|
|
284
|
+
userWarrantRecord?.totalWarrantsPurchased?.toString() ?? '0';
|
|
285
285
|
|
|
286
286
|
return {
|
|
287
287
|
native: {
|
|
@@ -357,6 +357,7 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
357
357
|
this.tokenClient.fetchTrancheState(),
|
|
358
358
|
]);
|
|
359
359
|
|
|
360
|
+
|
|
360
361
|
// Latest SOL/USD price (1e8) + timestamp from PriceHistory
|
|
361
362
|
const { price: solPriceUsd, timestamp } =
|
|
362
363
|
await this.tokenClient.getSolPriceUsdSafe();
|
|
@@ -99,7 +99,7 @@ export type GlobalState = {
|
|
|
99
99
|
export type UserWarrantRecord = {
|
|
100
100
|
user: PublicKey;
|
|
101
101
|
totalSolDeposited: BN;
|
|
102
|
-
|
|
102
|
+
totalWarrantsPurchased: BN;
|
|
103
103
|
lastTrancheNumber: BN;
|
|
104
104
|
lastTranchePriceUsd: BN;
|
|
105
105
|
bump: number;
|
|
@@ -110,10 +110,9 @@ export type TrancheState = {
|
|
|
110
110
|
currentTrancheNumber: BN;
|
|
111
111
|
currentTrancheSupply: BN;
|
|
112
112
|
currentTranchePriceUsd: BN;
|
|
113
|
-
//Currently working on renaming Warrants to
|
|
113
|
+
//Currently working on renaming Warrants to Warrants,
|
|
114
114
|
// current version of sol contracts appears to still
|
|
115
115
|
// be using warrants phrasing for this variable
|
|
116
|
-
totalPretokensSold?: BN;
|
|
117
116
|
totalWarrantsSold?: BN;
|
|
118
117
|
initialTrancheSupply: BN;
|
|
119
118
|
supplyGrowthBps: number;
|
|
@@ -116,7 +116,7 @@ export function buildSolanaTrancheLadder(options: {
|
|
|
116
116
|
currentTranche: number;
|
|
117
117
|
initialTrancheSupply: bigint;
|
|
118
118
|
currentTrancheSupply: bigint;
|
|
119
|
-
|
|
119
|
+
totalWarrantsSold: bigint; // informational only
|
|
120
120
|
currentPriceUsd: bigint;
|
|
121
121
|
supplyGrowthBps: number;
|
|
122
122
|
priceGrowthBps: number;
|
|
@@ -213,7 +213,7 @@ export function buildSolanaTrancheSnapshot(options: {
|
|
|
213
213
|
const currentTranche = trancheState.currentTrancheNumber.toNumber();
|
|
214
214
|
const currentTrancheSupply = toBigint(trancheState.currentTrancheSupply);
|
|
215
215
|
const initialTrancheSupply = toBigint(trancheState.initialTrancheSupply);
|
|
216
|
-
const
|
|
216
|
+
const totalWarrantsSold = toBigint(trancheState.totalWarrantsSold);
|
|
217
217
|
const currentPriceUsd = toBigint(trancheState.currentTranchePriceUsd);
|
|
218
218
|
|
|
219
219
|
const supplyGrowthBps = trancheState.supplyGrowthBps;
|
|
@@ -230,14 +230,14 @@ export function buildSolanaTrancheSnapshot(options: {
|
|
|
230
230
|
currentTranche,
|
|
231
231
|
initialTrancheSupply,
|
|
232
232
|
currentTrancheSupply,
|
|
233
|
-
|
|
233
|
+
totalWarrantsSold,
|
|
234
234
|
currentPriceUsd,
|
|
235
235
|
supplyGrowthBps,
|
|
236
236
|
priceGrowthBps,
|
|
237
237
|
windowBefore: ladderWindowBefore,
|
|
238
238
|
windowAfter: ladderWindowAfter,
|
|
239
239
|
});
|
|
240
|
-
|
|
240
|
+
|
|
241
241
|
return {
|
|
242
242
|
chainID,
|
|
243
243
|
currentIndex,
|
|
@@ -248,7 +248,7 @@ export function buildSolanaTrancheSnapshot(options: {
|
|
|
248
248
|
priceGrowthBps,
|
|
249
249
|
currentTrancheSupply,
|
|
250
250
|
initialTrancheSupply,
|
|
251
|
-
|
|
251
|
+
totalWarrantsSold,
|
|
252
252
|
nativePriceUsd: solPriceUsd,
|
|
253
253
|
nativePriceTimestamp,
|
|
254
254
|
ladder,
|
package/src/types.ts
CHANGED
|
@@ -113,7 +113,7 @@ export interface TrancheSnapshot {
|
|
|
113
113
|
/** Current tranche supply state (1e8 scale) */
|
|
114
114
|
currentTrancheSupply: bigint; // remaining in current tranche
|
|
115
115
|
initialTrancheSupply: bigint; // capacity for current tranche
|
|
116
|
-
|
|
116
|
+
totalWarrantsSold: bigint; // global cumulative sold (all tranches), 1e8
|
|
117
117
|
|
|
118
118
|
/** Native token → USD price if available (SOL/USD, ETH/USD, etc, 1e8 scale) */
|
|
119
119
|
nativePriceUsd?: bigint;
|