pump-trader 1.1.9 → 1.2.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/dist/index.js +7 -10
- package/index.js +4 -2
- package/index.ts +5 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -154,14 +154,8 @@ function parsePoolKeys(data) {
|
|
|
154
154
|
class PumpTrader {
|
|
155
155
|
constructor(rpc, wallet) {
|
|
156
156
|
this.connection = new web3_js_1.Connection(rpc, "confirmed");
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
this.publicKey = wallet.publicKey;
|
|
160
|
-
}
|
|
161
|
-
else {
|
|
162
|
-
this._wallet = wallet;
|
|
163
|
-
this.publicKey = wallet.publicKey;
|
|
164
|
-
}
|
|
157
|
+
this._wallet = wallet;
|
|
158
|
+
this.publicKey = wallet.publicKey;
|
|
165
159
|
this.global = web3_js_1.PublicKey.findProgramAddressSync([SEEDS.GLOBAL], PROGRAM_IDS.PUMP)[0];
|
|
166
160
|
this.globalState = null;
|
|
167
161
|
this.tokenProgramCache = new Map();
|
|
@@ -169,9 +163,12 @@ class PumpTrader {
|
|
|
169
163
|
async signTx(tx) {
|
|
170
164
|
if (this._wallet instanceof web3_js_1.Keypair) {
|
|
171
165
|
tx.sign(this._wallet);
|
|
172
|
-
return tx;
|
|
173
166
|
}
|
|
174
|
-
|
|
167
|
+
else {
|
|
168
|
+
const signed = await this._wallet.signTransaction(tx);
|
|
169
|
+
// Copy signatures back to the original tx (adapter returns a new tx)
|
|
170
|
+
tx.signatures = signed.signatures;
|
|
171
|
+
}
|
|
175
172
|
}
|
|
176
173
|
/* ---------- Token Program 检测 ---------- */
|
|
177
174
|
/**
|
package/index.js
CHANGED
|
@@ -193,9 +193,11 @@ export class PumpTrader {
|
|
|
193
193
|
async signTx(tx) {
|
|
194
194
|
if (this._wallet instanceof Keypair) {
|
|
195
195
|
tx.sign(this._wallet);
|
|
196
|
-
|
|
196
|
+
} else {
|
|
197
|
+
const signed = await this._wallet.signTransaction(tx);
|
|
198
|
+
// Copy signatures back to the original tx (adapter returns a new tx)
|
|
199
|
+
tx.signatures = signed.signatures;
|
|
197
200
|
}
|
|
198
|
-
return this._wallet.signTransaction(tx);
|
|
199
201
|
}
|
|
200
202
|
|
|
201
203
|
/* ---------- Token Program 检测 ---------- */
|
package/index.ts
CHANGED
|
@@ -335,12 +335,14 @@ export class PumpTrader {
|
|
|
335
335
|
this.tokenProgramCache = new Map();
|
|
336
336
|
}
|
|
337
337
|
|
|
338
|
-
private async signTx(tx: Transaction): Promise<
|
|
338
|
+
private async signTx(tx: Transaction): Promise<void> {
|
|
339
339
|
if (this._wallet instanceof Keypair) {
|
|
340
340
|
tx.sign(this._wallet);
|
|
341
|
-
|
|
341
|
+
} else {
|
|
342
|
+
const signed = await this._wallet.signTransaction(tx);
|
|
343
|
+
// Copy signatures back to the original tx (adapter returns a new tx)
|
|
344
|
+
tx.signatures = signed.signatures;
|
|
342
345
|
}
|
|
343
|
-
return this._wallet.signTransaction(tx);
|
|
344
346
|
}
|
|
345
347
|
|
|
346
348
|
/* ---------- Token Program 检测 ---------- */
|