hyperstack-stacks 0.3.0
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/LICENSE +21 -0
- package/README.md +93 -0
- package/dist/index.cjs +46 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +19 -0
- package/dist/pumpfun/index.cjs +46 -0
- package/dist/pumpfun/index.d.cts +152 -0
- package/dist/pumpfun/index.d.ts +152 -0
- package/dist/pumpfun/index.js +21 -0
- package/package.json +63 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Hypertek
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# hyperstack-stacks
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/hyperstack-stacks)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
|
|
6
|
+
Protocol stacks for Hyperstack - ready-to-use Solana data streams.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install hyperstack-stacks
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
### With hyperstack-react
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
import { useHyperstack } from 'hyperstack-react';
|
|
20
|
+
import { PUMPFUNTOKEN_STACK } from 'hyperstack-stacks/pumpfun';
|
|
21
|
+
|
|
22
|
+
function TokenList() {
|
|
23
|
+
const hs = useHyperstack(PUMPFUNTOKEN_STACK);
|
|
24
|
+
const tokens = hs.views.pumpfunToken.list.useWatch();
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<ul>
|
|
28
|
+
{tokens.map((token) => (
|
|
29
|
+
<li key={token.id?.mint}>
|
|
30
|
+
{token.info?.name} - {token.info?.symbol}
|
|
31
|
+
</li>
|
|
32
|
+
))}
|
|
33
|
+
</ul>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### With hyperstack-typescript (framework-agnostic)
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
import { HyperStack } from 'hyperstack-typescript';
|
|
42
|
+
import { PUMPFUNTOKEN_STACK, PumpfunToken } from 'hyperstack-stacks/pumpfun';
|
|
43
|
+
|
|
44
|
+
const hs = await HyperStack.connect('wss://mainnet.hyperstack.xyz', {
|
|
45
|
+
stack: PUMPFUNTOKEN_STACK,
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// Stream all token updates
|
|
49
|
+
for await (const update of hs.views.pumpfunToken.list.watch()) {
|
|
50
|
+
if (update.type === 'upsert') {
|
|
51
|
+
console.log('Token updated:', update.data.info?.name);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Available Stacks
|
|
57
|
+
|
|
58
|
+
### PumpFun Token Stack
|
|
59
|
+
|
|
60
|
+
Real-time streaming data for PumpFun tokens on Solana.
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
import { PUMPFUNTOKEN_STACK, PumpfunToken } from 'hyperstack-stacks/pumpfun';
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Entity: `PumpfunToken`**
|
|
67
|
+
|
|
68
|
+
| Field | Type | Description |
|
|
69
|
+
|-------|------|-------------|
|
|
70
|
+
| `id` | `PumpfunTokenId` | Token identifiers (mint, bonding curve) |
|
|
71
|
+
| `info` | `PumpfunTokenInfo` | Token metadata (name, symbol, URI) |
|
|
72
|
+
| `reserves` | `PumpfunTokenReserves` | Current reserve state and pricing |
|
|
73
|
+
| `trading` | `PumpfunTokenTrading` | Trading statistics and metrics |
|
|
74
|
+
| `events` | `PumpfunTokenEvents` | Recent buy/sell/create events |
|
|
75
|
+
|
|
76
|
+
## Peer Dependencies
|
|
77
|
+
|
|
78
|
+
This package requires one of:
|
|
79
|
+
|
|
80
|
+
- `hyperstack-react` - For React applications
|
|
81
|
+
- `hyperstack-typescript` - For framework-agnostic usage
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# For React
|
|
85
|
+
npm install hyperstack-react hyperstack-stacks
|
|
86
|
+
|
|
87
|
+
# For vanilla TypeScript/JavaScript
|
|
88
|
+
npm install hyperstack-typescript hyperstack-stacks
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
MIT
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
PUMPFUNTOKEN_STACK: () => PUMPFUNTOKEN_STACK
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(src_exports);
|
|
26
|
+
|
|
27
|
+
// src/pumpfun/index.ts
|
|
28
|
+
function stateView(view) {
|
|
29
|
+
return { mode: "state", view };
|
|
30
|
+
}
|
|
31
|
+
function listView(view) {
|
|
32
|
+
return { mode: "list", view };
|
|
33
|
+
}
|
|
34
|
+
var PUMPFUNTOKEN_STACK = {
|
|
35
|
+
name: "pumpfun-token",
|
|
36
|
+
views: {
|
|
37
|
+
pumpfunToken: {
|
|
38
|
+
state: stateView("PumpfunToken/state"),
|
|
39
|
+
list: listView("PumpfunToken/list")
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
PUMPFUNTOKEN_STACK
|
|
46
|
+
});
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BondingCurve, Buy, BuysEvent, Create, CreateEvent, EventWrapper, default as PUMPFUNTOKEN_STACK, PumpfunToken, PumpfunTokenEvents, PumpfunTokenId, PumpfunTokenInfo, PumpfunTokenReserves, PumpfunTokenStack, PumpfunTokenTrading, Sell, SellsEvent, ViewDef } from './pumpfun/index.cjs';
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BondingCurve, Buy, BuysEvent, Create, CreateEvent, EventWrapper, default as PUMPFUNTOKEN_STACK, PumpfunToken, PumpfunTokenEvents, PumpfunTokenId, PumpfunTokenInfo, PumpfunTokenReserves, PumpfunTokenStack, PumpfunTokenTrading, Sell, SellsEvent, ViewDef } from './pumpfun/index.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// src/pumpfun/index.ts
|
|
2
|
+
function stateView(view) {
|
|
3
|
+
return { mode: "state", view };
|
|
4
|
+
}
|
|
5
|
+
function listView(view) {
|
|
6
|
+
return { mode: "list", view };
|
|
7
|
+
}
|
|
8
|
+
var PUMPFUNTOKEN_STACK = {
|
|
9
|
+
name: "pumpfun-token",
|
|
10
|
+
views: {
|
|
11
|
+
pumpfunToken: {
|
|
12
|
+
state: stateView("PumpfunToken/state"),
|
|
13
|
+
list: listView("PumpfunToken/list")
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
PUMPFUNTOKEN_STACK
|
|
19
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/pumpfun/index.ts
|
|
21
|
+
var pumpfun_exports = {};
|
|
22
|
+
__export(pumpfun_exports, {
|
|
23
|
+
PUMPFUNTOKEN_STACK: () => PUMPFUNTOKEN_STACK,
|
|
24
|
+
default: () => pumpfun_default
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(pumpfun_exports);
|
|
27
|
+
function stateView(view) {
|
|
28
|
+
return { mode: "state", view };
|
|
29
|
+
}
|
|
30
|
+
function listView(view) {
|
|
31
|
+
return { mode: "list", view };
|
|
32
|
+
}
|
|
33
|
+
var PUMPFUNTOKEN_STACK = {
|
|
34
|
+
name: "pumpfun-token",
|
|
35
|
+
views: {
|
|
36
|
+
pumpfunToken: {
|
|
37
|
+
state: stateView("PumpfunToken/state"),
|
|
38
|
+
list: listView("PumpfunToken/list")
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var pumpfun_default = PUMPFUNTOKEN_STACK;
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
PUMPFUNTOKEN_STACK
|
|
46
|
+
});
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
interface PumpfunTokenEvents {
|
|
2
|
+
buys?: EventWrapper<Buy>[];
|
|
3
|
+
create?: Create | null;
|
|
4
|
+
sells?: EventWrapper<Sell>[];
|
|
5
|
+
}
|
|
6
|
+
interface PumpfunTokenId {
|
|
7
|
+
bondingCurve?: string;
|
|
8
|
+
mint?: string;
|
|
9
|
+
}
|
|
10
|
+
interface PumpfunTokenInfo {
|
|
11
|
+
isComplete?: boolean | null;
|
|
12
|
+
name?: string | null;
|
|
13
|
+
symbol?: string | null;
|
|
14
|
+
uri?: string | null;
|
|
15
|
+
}
|
|
16
|
+
interface PumpfunTokenReserves {
|
|
17
|
+
currentPriceSol?: number | null;
|
|
18
|
+
marketCapSol?: number | null;
|
|
19
|
+
realSolReserves?: number | null;
|
|
20
|
+
realTokenReserves?: number | null;
|
|
21
|
+
tokenTotalSupply?: number | null;
|
|
22
|
+
virtualSolReserves?: number | null;
|
|
23
|
+
virtualTokenReserves?: number | null;
|
|
24
|
+
}
|
|
25
|
+
interface PumpfunTokenTrading {
|
|
26
|
+
averageTradeSize?: number | null;
|
|
27
|
+
buyCount?: number | null;
|
|
28
|
+
largestTrade?: number | null;
|
|
29
|
+
lastTradePrice?: number | null;
|
|
30
|
+
lastTradeTimestamp?: number | null;
|
|
31
|
+
lastWhaleAddress?: string | null;
|
|
32
|
+
sellCount?: number | null;
|
|
33
|
+
smallestTrade?: number | null;
|
|
34
|
+
totalBuyVolume?: number | null;
|
|
35
|
+
totalSellVolume?: number | null;
|
|
36
|
+
totalTrades?: number | null;
|
|
37
|
+
totalVolume?: number | null;
|
|
38
|
+
uniqueTraders?: number | null;
|
|
39
|
+
whaleTradeCount?: number | null;
|
|
40
|
+
}
|
|
41
|
+
interface PumpfunToken {
|
|
42
|
+
events?: PumpfunTokenEvents;
|
|
43
|
+
id?: PumpfunTokenId;
|
|
44
|
+
info?: PumpfunTokenInfo;
|
|
45
|
+
reserves?: PumpfunTokenReserves;
|
|
46
|
+
trading?: PumpfunTokenTrading;
|
|
47
|
+
bondingCurveSnapshot?: BondingCurve | null;
|
|
48
|
+
}
|
|
49
|
+
interface Create {
|
|
50
|
+
mint?: string;
|
|
51
|
+
mintAuthority?: string;
|
|
52
|
+
bondingCurve?: string;
|
|
53
|
+
associatedBondingCurve?: string;
|
|
54
|
+
global?: string;
|
|
55
|
+
mplTokenMetadata?: string;
|
|
56
|
+
metadata?: string;
|
|
57
|
+
user?: string;
|
|
58
|
+
systemProgram?: string;
|
|
59
|
+
tokenProgram?: string;
|
|
60
|
+
associatedTokenProgram?: string;
|
|
61
|
+
rent?: string;
|
|
62
|
+
eventAuthority?: string;
|
|
63
|
+
program?: string;
|
|
64
|
+
name?: string;
|
|
65
|
+
symbol?: string;
|
|
66
|
+
uri?: string;
|
|
67
|
+
creator?: string;
|
|
68
|
+
}
|
|
69
|
+
interface Buy {
|
|
70
|
+
global?: string;
|
|
71
|
+
feeRecipient?: string;
|
|
72
|
+
mint?: string;
|
|
73
|
+
bondingCurve?: string;
|
|
74
|
+
associatedBondingCurve?: string;
|
|
75
|
+
associatedUser?: string;
|
|
76
|
+
user?: string;
|
|
77
|
+
systemProgram?: string;
|
|
78
|
+
tokenProgram?: string;
|
|
79
|
+
creatorVault?: string;
|
|
80
|
+
eventAuthority?: string;
|
|
81
|
+
program?: string;
|
|
82
|
+
amount?: number;
|
|
83
|
+
maxSolCost?: number;
|
|
84
|
+
}
|
|
85
|
+
interface Sell {
|
|
86
|
+
global?: string;
|
|
87
|
+
feeRecipient?: string;
|
|
88
|
+
mint?: string;
|
|
89
|
+
bondingCurve?: string;
|
|
90
|
+
associatedBondingCurve?: string;
|
|
91
|
+
associatedUser?: string;
|
|
92
|
+
user?: string;
|
|
93
|
+
systemProgram?: string;
|
|
94
|
+
creatorVault?: string;
|
|
95
|
+
tokenProgram?: string;
|
|
96
|
+
eventAuthority?: string;
|
|
97
|
+
program?: string;
|
|
98
|
+
amount?: number;
|
|
99
|
+
minSolOutput?: number;
|
|
100
|
+
}
|
|
101
|
+
interface BondingCurve {
|
|
102
|
+
virtualTokenReserves?: number;
|
|
103
|
+
virtualSolReserves?: number;
|
|
104
|
+
realTokenReserves?: number;
|
|
105
|
+
realSolReserves?: number;
|
|
106
|
+
tokenTotalSupply?: number;
|
|
107
|
+
complete?: boolean;
|
|
108
|
+
creator?: string;
|
|
109
|
+
}
|
|
110
|
+
interface BuysEvent {
|
|
111
|
+
amount: number;
|
|
112
|
+
maxSolCost: number;
|
|
113
|
+
}
|
|
114
|
+
interface CreateEvent {
|
|
115
|
+
}
|
|
116
|
+
interface SellsEvent {
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Wrapper for event data that includes context metadata.
|
|
120
|
+
* Events are automatically wrapped in this structure at runtime.
|
|
121
|
+
*/
|
|
122
|
+
interface EventWrapper<T> {
|
|
123
|
+
/** Unix timestamp when the event was processed */
|
|
124
|
+
timestamp: number;
|
|
125
|
+
/** The event-specific data */
|
|
126
|
+
data: T;
|
|
127
|
+
/** Optional blockchain slot number */
|
|
128
|
+
slot?: number;
|
|
129
|
+
/** Optional transaction signature */
|
|
130
|
+
signature?: string;
|
|
131
|
+
}
|
|
132
|
+
/** View definition with embedded entity type */
|
|
133
|
+
interface ViewDef<T, TMode extends 'state' | 'list'> {
|
|
134
|
+
readonly mode: TMode;
|
|
135
|
+
readonly view: string;
|
|
136
|
+
/** Phantom field for type inference - not present at runtime */
|
|
137
|
+
readonly _entity?: T;
|
|
138
|
+
}
|
|
139
|
+
/** Stack definition for PumpfunToken */
|
|
140
|
+
declare const PUMPFUNTOKEN_STACK: {
|
|
141
|
+
readonly name: "pumpfun-token";
|
|
142
|
+
readonly views: {
|
|
143
|
+
readonly pumpfunToken: {
|
|
144
|
+
readonly state: ViewDef<PumpfunToken, "state">;
|
|
145
|
+
readonly list: ViewDef<PumpfunToken, "list">;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
/** Type alias for the stack */
|
|
150
|
+
type PumpfunTokenStack = typeof PUMPFUNTOKEN_STACK;
|
|
151
|
+
|
|
152
|
+
export { type BondingCurve, type Buy, type BuysEvent, type Create, type CreateEvent, type EventWrapper, PUMPFUNTOKEN_STACK, type PumpfunToken, type PumpfunTokenEvents, type PumpfunTokenId, type PumpfunTokenInfo, type PumpfunTokenReserves, type PumpfunTokenStack, type PumpfunTokenTrading, type Sell, type SellsEvent, type ViewDef, PUMPFUNTOKEN_STACK as default };
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
interface PumpfunTokenEvents {
|
|
2
|
+
buys?: EventWrapper<Buy>[];
|
|
3
|
+
create?: Create | null;
|
|
4
|
+
sells?: EventWrapper<Sell>[];
|
|
5
|
+
}
|
|
6
|
+
interface PumpfunTokenId {
|
|
7
|
+
bondingCurve?: string;
|
|
8
|
+
mint?: string;
|
|
9
|
+
}
|
|
10
|
+
interface PumpfunTokenInfo {
|
|
11
|
+
isComplete?: boolean | null;
|
|
12
|
+
name?: string | null;
|
|
13
|
+
symbol?: string | null;
|
|
14
|
+
uri?: string | null;
|
|
15
|
+
}
|
|
16
|
+
interface PumpfunTokenReserves {
|
|
17
|
+
currentPriceSol?: number | null;
|
|
18
|
+
marketCapSol?: number | null;
|
|
19
|
+
realSolReserves?: number | null;
|
|
20
|
+
realTokenReserves?: number | null;
|
|
21
|
+
tokenTotalSupply?: number | null;
|
|
22
|
+
virtualSolReserves?: number | null;
|
|
23
|
+
virtualTokenReserves?: number | null;
|
|
24
|
+
}
|
|
25
|
+
interface PumpfunTokenTrading {
|
|
26
|
+
averageTradeSize?: number | null;
|
|
27
|
+
buyCount?: number | null;
|
|
28
|
+
largestTrade?: number | null;
|
|
29
|
+
lastTradePrice?: number | null;
|
|
30
|
+
lastTradeTimestamp?: number | null;
|
|
31
|
+
lastWhaleAddress?: string | null;
|
|
32
|
+
sellCount?: number | null;
|
|
33
|
+
smallestTrade?: number | null;
|
|
34
|
+
totalBuyVolume?: number | null;
|
|
35
|
+
totalSellVolume?: number | null;
|
|
36
|
+
totalTrades?: number | null;
|
|
37
|
+
totalVolume?: number | null;
|
|
38
|
+
uniqueTraders?: number | null;
|
|
39
|
+
whaleTradeCount?: number | null;
|
|
40
|
+
}
|
|
41
|
+
interface PumpfunToken {
|
|
42
|
+
events?: PumpfunTokenEvents;
|
|
43
|
+
id?: PumpfunTokenId;
|
|
44
|
+
info?: PumpfunTokenInfo;
|
|
45
|
+
reserves?: PumpfunTokenReserves;
|
|
46
|
+
trading?: PumpfunTokenTrading;
|
|
47
|
+
bondingCurveSnapshot?: BondingCurve | null;
|
|
48
|
+
}
|
|
49
|
+
interface Create {
|
|
50
|
+
mint?: string;
|
|
51
|
+
mintAuthority?: string;
|
|
52
|
+
bondingCurve?: string;
|
|
53
|
+
associatedBondingCurve?: string;
|
|
54
|
+
global?: string;
|
|
55
|
+
mplTokenMetadata?: string;
|
|
56
|
+
metadata?: string;
|
|
57
|
+
user?: string;
|
|
58
|
+
systemProgram?: string;
|
|
59
|
+
tokenProgram?: string;
|
|
60
|
+
associatedTokenProgram?: string;
|
|
61
|
+
rent?: string;
|
|
62
|
+
eventAuthority?: string;
|
|
63
|
+
program?: string;
|
|
64
|
+
name?: string;
|
|
65
|
+
symbol?: string;
|
|
66
|
+
uri?: string;
|
|
67
|
+
creator?: string;
|
|
68
|
+
}
|
|
69
|
+
interface Buy {
|
|
70
|
+
global?: string;
|
|
71
|
+
feeRecipient?: string;
|
|
72
|
+
mint?: string;
|
|
73
|
+
bondingCurve?: string;
|
|
74
|
+
associatedBondingCurve?: string;
|
|
75
|
+
associatedUser?: string;
|
|
76
|
+
user?: string;
|
|
77
|
+
systemProgram?: string;
|
|
78
|
+
tokenProgram?: string;
|
|
79
|
+
creatorVault?: string;
|
|
80
|
+
eventAuthority?: string;
|
|
81
|
+
program?: string;
|
|
82
|
+
amount?: number;
|
|
83
|
+
maxSolCost?: number;
|
|
84
|
+
}
|
|
85
|
+
interface Sell {
|
|
86
|
+
global?: string;
|
|
87
|
+
feeRecipient?: string;
|
|
88
|
+
mint?: string;
|
|
89
|
+
bondingCurve?: string;
|
|
90
|
+
associatedBondingCurve?: string;
|
|
91
|
+
associatedUser?: string;
|
|
92
|
+
user?: string;
|
|
93
|
+
systemProgram?: string;
|
|
94
|
+
creatorVault?: string;
|
|
95
|
+
tokenProgram?: string;
|
|
96
|
+
eventAuthority?: string;
|
|
97
|
+
program?: string;
|
|
98
|
+
amount?: number;
|
|
99
|
+
minSolOutput?: number;
|
|
100
|
+
}
|
|
101
|
+
interface BondingCurve {
|
|
102
|
+
virtualTokenReserves?: number;
|
|
103
|
+
virtualSolReserves?: number;
|
|
104
|
+
realTokenReserves?: number;
|
|
105
|
+
realSolReserves?: number;
|
|
106
|
+
tokenTotalSupply?: number;
|
|
107
|
+
complete?: boolean;
|
|
108
|
+
creator?: string;
|
|
109
|
+
}
|
|
110
|
+
interface BuysEvent {
|
|
111
|
+
amount: number;
|
|
112
|
+
maxSolCost: number;
|
|
113
|
+
}
|
|
114
|
+
interface CreateEvent {
|
|
115
|
+
}
|
|
116
|
+
interface SellsEvent {
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Wrapper for event data that includes context metadata.
|
|
120
|
+
* Events are automatically wrapped in this structure at runtime.
|
|
121
|
+
*/
|
|
122
|
+
interface EventWrapper<T> {
|
|
123
|
+
/** Unix timestamp when the event was processed */
|
|
124
|
+
timestamp: number;
|
|
125
|
+
/** The event-specific data */
|
|
126
|
+
data: T;
|
|
127
|
+
/** Optional blockchain slot number */
|
|
128
|
+
slot?: number;
|
|
129
|
+
/** Optional transaction signature */
|
|
130
|
+
signature?: string;
|
|
131
|
+
}
|
|
132
|
+
/** View definition with embedded entity type */
|
|
133
|
+
interface ViewDef<T, TMode extends 'state' | 'list'> {
|
|
134
|
+
readonly mode: TMode;
|
|
135
|
+
readonly view: string;
|
|
136
|
+
/** Phantom field for type inference - not present at runtime */
|
|
137
|
+
readonly _entity?: T;
|
|
138
|
+
}
|
|
139
|
+
/** Stack definition for PumpfunToken */
|
|
140
|
+
declare const PUMPFUNTOKEN_STACK: {
|
|
141
|
+
readonly name: "pumpfun-token";
|
|
142
|
+
readonly views: {
|
|
143
|
+
readonly pumpfunToken: {
|
|
144
|
+
readonly state: ViewDef<PumpfunToken, "state">;
|
|
145
|
+
readonly list: ViewDef<PumpfunToken, "list">;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
/** Type alias for the stack */
|
|
150
|
+
type PumpfunTokenStack = typeof PUMPFUNTOKEN_STACK;
|
|
151
|
+
|
|
152
|
+
export { type BondingCurve, type Buy, type BuysEvent, type Create, type CreateEvent, type EventWrapper, PUMPFUNTOKEN_STACK, type PumpfunToken, type PumpfunTokenEvents, type PumpfunTokenId, type PumpfunTokenInfo, type PumpfunTokenReserves, type PumpfunTokenStack, type PumpfunTokenTrading, type Sell, type SellsEvent, type ViewDef, PUMPFUNTOKEN_STACK as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// src/pumpfun/index.ts
|
|
2
|
+
function stateView(view) {
|
|
3
|
+
return { mode: "state", view };
|
|
4
|
+
}
|
|
5
|
+
function listView(view) {
|
|
6
|
+
return { mode: "list", view };
|
|
7
|
+
}
|
|
8
|
+
var PUMPFUNTOKEN_STACK = {
|
|
9
|
+
name: "pumpfun-token",
|
|
10
|
+
views: {
|
|
11
|
+
pumpfunToken: {
|
|
12
|
+
state: stateView("PumpfunToken/state"),
|
|
13
|
+
list: listView("PumpfunToken/list")
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var pumpfun_default = PUMPFUNTOKEN_STACK;
|
|
18
|
+
export {
|
|
19
|
+
PUMPFUNTOKEN_STACK,
|
|
20
|
+
pumpfun_default as default
|
|
21
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "hyperstack-stacks",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Protocol stacks for Hyperstack - ready-to-use Solana data streams",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.cjs",
|
|
7
|
+
"module": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
},
|
|
15
|
+
"./pumpfun": {
|
|
16
|
+
"types": "./dist/pumpfun/index.d.ts",
|
|
17
|
+
"import": "./dist/pumpfun/index.js",
|
|
18
|
+
"require": "./dist/pumpfun/index.cjs"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"README.md",
|
|
24
|
+
"LICENSE"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsup",
|
|
28
|
+
"prepublishOnly": "npm run build"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"hyperstack-react": ">=0.2.0",
|
|
32
|
+
"hyperstack-typescript": ">=0.2.0"
|
|
33
|
+
},
|
|
34
|
+
"peerDependenciesMeta": {
|
|
35
|
+
"hyperstack-react": {
|
|
36
|
+
"optional": true
|
|
37
|
+
},
|
|
38
|
+
"hyperstack-typescript": {
|
|
39
|
+
"optional": true
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"tsup": "^8.0.0",
|
|
44
|
+
"typescript": "^5.0.0"
|
|
45
|
+
},
|
|
46
|
+
"keywords": [
|
|
47
|
+
"hyperstack",
|
|
48
|
+
"solana",
|
|
49
|
+
"blockchain",
|
|
50
|
+
"streaming",
|
|
51
|
+
"pumpfun"
|
|
52
|
+
],
|
|
53
|
+
"author": "HyperTek",
|
|
54
|
+
"license": "MIT",
|
|
55
|
+
"repository": {
|
|
56
|
+
"type": "git",
|
|
57
|
+
"url": "https://github.com/HyperTekOrg/hyperstack.git",
|
|
58
|
+
"directory": "stacks/sdk/typescript"
|
|
59
|
+
},
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"access": "public"
|
|
62
|
+
}
|
|
63
|
+
}
|