@pompafly/sdk 0.1.0 → 0.1.2

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/dist/index.js CHANGED
@@ -49,7 +49,6 @@ module.exports = __toCommonJS(index_exports);
49
49
  var import_web32 = require("@solana/web3.js");
50
50
  var import_spl_token2 = require("@solana/spl-token");
51
51
  var import_bn = __toESM(require("bn.js"));
52
- var import_crypto = require("crypto");
53
52
 
54
53
  // src/types/index.ts
55
54
  var DEVNET_CONFIG = {
@@ -110,9 +109,16 @@ var PROGRAM_CONSTANTS = {
110
109
  };
111
110
 
112
111
  // src/client/index.ts
112
+ var DISCRIMINATORS = {
113
+ "global:initialize_config": Buffer.from([208, 127, 21, 1, 194, 190, 196, 70]),
114
+ "global:initialize_pool": Buffer.from([95, 180, 10, 172, 84, 174, 232, 40]),
115
+ "global:buy": Buffer.from([102, 6, 61, 18, 1, 218, 235, 234]),
116
+ "global:sell": Buffer.from([51, 230, 133, 164, 1, 127, 131, 173]),
117
+ "global:collect_fees": Buffer.from([164, 152, 207, 99, 30, 186, 19, 182]),
118
+ "global:graduate": Buffer.from([45, 235, 225, 181, 17, 218, 64, 130])
119
+ };
113
120
  function ixDiscriminator(namespace, name) {
114
- const hash = (0, import_crypto.createHash)("sha256").update(`${namespace}:${name}`).digest();
115
- return hash.subarray(0, 8);
121
+ return DISCRIMINATORS[`${namespace}:${name}`];
116
122
  }
117
123
  function encodeString(s) {
118
124
  const strBytes = Buffer.from(s, "utf8");
@@ -229,6 +235,8 @@ var PompaflyClient = class {
229
235
  ];
230
236
  if (prioritySigner) {
231
237
  keys.push({ pubkey: prioritySigner.publicKey, isSigner: true, isWritable: false });
238
+ } else {
239
+ keys.push({ pubkey: this.publicKey, isSigner: false, isWritable: false });
232
240
  }
233
241
  keys.push(
234
242
  { pubkey: import_spl_token2.TOKEN_PROGRAM_ID, isSigner: false, isWritable: false },
package/dist/index.mjs CHANGED
@@ -14,7 +14,6 @@ import {
14
14
  getAssociatedTokenAddress as getAssociatedTokenAddress2
15
15
  } from "@solana/spl-token";
16
16
  import BN from "bn.js";
17
- import { createHash } from "crypto";
18
17
 
19
18
  // src/types/index.ts
20
19
  var DEVNET_CONFIG = {
@@ -79,9 +78,16 @@ var PROGRAM_CONSTANTS = {
79
78
  };
80
79
 
81
80
  // src/client/index.ts
81
+ var DISCRIMINATORS = {
82
+ "global:initialize_config": Buffer.from([208, 127, 21, 1, 194, 190, 196, 70]),
83
+ "global:initialize_pool": Buffer.from([95, 180, 10, 172, 84, 174, 232, 40]),
84
+ "global:buy": Buffer.from([102, 6, 61, 18, 1, 218, 235, 234]),
85
+ "global:sell": Buffer.from([51, 230, 133, 164, 1, 127, 131, 173]),
86
+ "global:collect_fees": Buffer.from([164, 152, 207, 99, 30, 186, 19, 182]),
87
+ "global:graduate": Buffer.from([45, 235, 225, 181, 17, 218, 64, 130])
88
+ };
82
89
  function ixDiscriminator(namespace, name) {
83
- const hash = createHash("sha256").update(`${namespace}:${name}`).digest();
84
- return hash.subarray(0, 8);
90
+ return DISCRIMINATORS[`${namespace}:${name}`];
85
91
  }
86
92
  function encodeString(s) {
87
93
  const strBytes = Buffer.from(s, "utf8");
@@ -198,6 +204,8 @@ var PompaflyClient = class {
198
204
  ];
199
205
  if (prioritySigner) {
200
206
  keys.push({ pubkey: prioritySigner.publicKey, isSigner: true, isWritable: false });
207
+ } else {
208
+ keys.push({ pubkey: this.publicKey, isSigner: false, isWritable: false });
201
209
  }
202
210
  keys.push(
203
211
  { pubkey: TOKEN_PROGRAM_ID2, isSigner: false, isWritable: false },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pompafly/sdk",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "TypeScript SDK for the Pompafly token launchpad on Solana",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",