@solard/sdk 0.2.15 → 0.2.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solard/sdk",
3
- "version": "0.2.15",
3
+ "version": "0.2.16",
4
4
  "description": "Public Solard SDK for wallets, transactions, trading and token launches.",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -22,7 +22,7 @@
22
22
  "license": "MIT",
23
23
  "dependencies": {
24
24
  "@solana/web3.js": "^1.98.4",
25
- "@solard/core": "0.2.15"
25
+ "@solard/core": "0.2.16"
26
26
  },
27
27
  "scripts": {
28
28
  "typecheck": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.browser.json",
@@ -19,11 +19,13 @@ import { readMint } from "@solard/core/chain/state.ts";
19
19
  import {
20
20
  subscribeTokenEvents,
21
21
  type SubscribeTokenEventsOptions,
22
+ type TokenEventSubscription,
22
23
  } from "@solard/core/events/token-events.ts";
23
24
  import type { TokenRow } from "@solard/core/db/schema.ts";
24
25
  import { PumpCurveVenue } from "@solard/core/venues/pump/pump-curve-venue.ts";
25
26
  import { PumpSwapVenue } from "@solard/core/venues/pump/pumpswap-venue.ts";
26
27
  import { VenueRegistry } from "@solard/core/venues/route-resolver.ts";
28
+ import { PumpPairService } from "@solard/core/launches/pump/pairs.ts";
27
29
 
28
30
  import { BrowserSolardStore, defaultBrowserStorage } from "./storage.ts";
29
31
  import { buildLocalPumpBuy, buildLocalPumpSell } from "./pump.ts";
@@ -43,7 +45,7 @@ export const SOL_MINT = "So11111111111111111111111111111111111111112";
43
45
  export const USDC_MINT = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
44
46
  export const TOKEN_PROGRAM_ID = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
45
47
  export const TOKEN_2022_PROGRAM_ID =
46
- "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHn5qCXEpPxuEb";
48
+ "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
47
49
 
48
50
  const CANONICAL_LABELS: Record<string, string> = {
49
51
  [SOL_MINT]: "WSOL",
@@ -114,6 +116,13 @@ export class BrowserSolard {
114
116
  readonly store: BrowserSolardStore;
115
117
  readonly contacts;
116
118
  readonly tokens;
119
+ readonly pump: PumpPairService;
120
+ readonly events: {
121
+ subscribeToken: (
122
+ token: string,
123
+ options?: SubscribeTokenEventsOptions,
124
+ ) => Promise<TokenEventSubscription>;
125
+ };
117
126
  private wallet: BrowserWalletSigner | null;
118
127
 
119
128
  constructor(readonly options: BrowserSolardOptions) {
@@ -127,6 +136,11 @@ export class BrowserSolard {
127
136
  fetch: rpcFetch,
128
137
  });
129
138
  this.wallet = options.wallet ?? null;
139
+ this.pump = new PumpPairService(() => this.connection);
140
+ this.events = {
141
+ subscribeToken: (token, eventOptions = {}) =>
142
+ this.subscribeTokenEvents(token, eventOptions),
143
+ };
130
144
  this.store = new BrowserSolardStore(
131
145
  options.storage ?? defaultBrowserStorage(),
132
146
  options.storageNamespace ?? "solard:browser:v1",
@@ -20,6 +20,11 @@ export {
20
20
  } from "./storage.ts";
21
21
  export { BrowserKeyVault, KeypairBrowserSigner } from "./wallet.ts";
22
22
  export { buildLocalPumpBuy, buildLocalPumpSell } from "./pump.ts";
23
+ export {
24
+ getSupportedPumpPairs,
25
+ PumpPairService,
26
+ } from "@solard/core/launches/pump/pairs.ts";
27
+ export type { PumpSupportedPair } from "@solard/core/launches/pump/pairs.ts";
23
28
  export {
24
29
  PUMP_USDC_MINT,
25
30
  buildPumpExternalDeployment,
@@ -39,6 +44,7 @@ export type {
39
44
  } from "@solard/core/chain/holders.ts";
40
45
  export { subscribeTokenEvents } from "@solard/core/events/token-events.ts";
41
46
  export type {
47
+ SolardTokenCreateEvent,
42
48
  SolardTokenEvent,
43
49
  SolardTokenSwapEvent,
44
50
  SolardTokenTransferEvent,