four-flap-meme-sdk 1.9.40 → 1.9.41
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.
|
@@ -45,7 +45,7 @@ export async function directBuy(params) {
|
|
|
45
45
|
const provider = new JsonRpcProvider(params.rpcUrl ?? ENI_RPC_URL, ENI_CHAIN_ID, { staticNetwork: true });
|
|
46
46
|
const wallet = new Wallet(params.privateKey, provider);
|
|
47
47
|
const calldata = encodeBuyCall(params.token, params.amountOutMin ?? 0n);
|
|
48
|
-
const nonce = params.nonce ?? await wallet.getNonce();
|
|
48
|
+
const nonce = params.nonce ?? await wallet.getNonce('pending');
|
|
49
49
|
const feeData = await provider.getFeeData();
|
|
50
50
|
const tx = await wallet.signTransaction({
|
|
51
51
|
to: DAOAAS_PORTAL,
|
|
@@ -70,7 +70,7 @@ export async function directSell(params) {
|
|
|
70
70
|
const provider = new JsonRpcProvider(params.rpcUrl ?? ENI_RPC_URL, ENI_CHAIN_ID, { staticNetwork: true });
|
|
71
71
|
const wallet = new Wallet(params.privateKey, provider);
|
|
72
72
|
const calldata = encodeSellCall(params.token, params.tokenAmount, params.amountOutMin ?? 0n);
|
|
73
|
-
const nonce = params.nonce ?? await wallet.getNonce();
|
|
73
|
+
const nonce = params.nonce ?? await wallet.getNonce('pending');
|
|
74
74
|
const feeData = await provider.getFeeData();
|
|
75
75
|
const tx = await wallet.signTransaction({
|
|
76
76
|
to: DAOAAS_PORTAL,
|
|
@@ -109,7 +109,7 @@ export async function directBatchBuy(params) {
|
|
|
109
109
|
const preview = await query.previewBuy(token, amounts[i]);
|
|
110
110
|
const minOut = applySlippage(preview, slippageBps);
|
|
111
111
|
const calldata = encodeBuyCall(token, minOut);
|
|
112
|
-
const nonce = await wallet.getNonce();
|
|
112
|
+
const nonce = await wallet.getNonce('pending');
|
|
113
113
|
const signedTx = await wallet.signTransaction({
|
|
114
114
|
to: DAOAAS_PORTAL,
|
|
115
115
|
value: amounts[i],
|
|
@@ -145,7 +145,7 @@ export async function directBatchSell(params) {
|
|
|
145
145
|
const preview = await query.previewSell(token, tokenAmounts[i]);
|
|
146
146
|
const minOut = applySlippage(preview, slippageBps);
|
|
147
147
|
const calldata = encodeSellCall(token, tokenAmounts[i], minOut);
|
|
148
|
-
const nonce = await wallet.getNonce();
|
|
148
|
+
const nonce = await wallet.getNonce('pending');
|
|
149
149
|
const signedTx = await wallet.signTransaction({
|
|
150
150
|
to: DAOAAS_PORTAL,
|
|
151
151
|
data: calldata,
|
|
@@ -283,7 +283,7 @@ export async function directBatchBuyForSubmit(params) {
|
|
|
283
283
|
: slippageBps;
|
|
284
284
|
const minOut = applySlippage(preview, effectiveSlippage);
|
|
285
285
|
const calldata = encodeBuyCall(token, minOut);
|
|
286
|
-
const nonce = await wallet.getNonce();
|
|
286
|
+
const nonce = await wallet.getNonce('pending');
|
|
287
287
|
const signedTx = await wallet.signTransaction({
|
|
288
288
|
to: DAOAAS_PORTAL,
|
|
289
289
|
value: amounts[i],
|
|
@@ -340,7 +340,7 @@ export async function directBatchSellForSubmit(params) {
|
|
|
340
340
|
: slippageBps;
|
|
341
341
|
const minOut = applySlippage(preview, effectiveSlippage);
|
|
342
342
|
const calldata = encodeSellCall(token, tokenAmounts[i], minOut);
|
|
343
|
-
const nonce = await wallet.getNonce();
|
|
343
|
+
const nonce = await wallet.getNonce('pending');
|
|
344
344
|
const signedTx = await wallet.signTransaction({
|
|
345
345
|
to: DAOAAS_PORTAL,
|
|
346
346
|
data: calldata,
|
|
@@ -401,7 +401,7 @@ export async function directQuickSwapForSubmit(params) {
|
|
|
401
401
|
const otherSellTxs = sellResult.transactions.filter(tx => tx.from.toLowerCase() === otherWallet.address.toLowerCase());
|
|
402
402
|
const otherNextNonce = otherSellTxs.length > 0
|
|
403
403
|
? Math.max(...otherSellTxs.map(tx => tx.nonce)) + 1
|
|
404
|
-
: await otherWallet.getNonce();
|
|
404
|
+
: await otherWallet.getNonce('pending');
|
|
405
405
|
const otherBalance = await provider.getBalance(otherWallet.address);
|
|
406
406
|
const reserveGas = NATIVE_TRANSFER_GAS_LIMIT * maxFeePerGas;
|
|
407
407
|
const transferable = otherBalance - reserveGas;
|
|
@@ -427,7 +427,7 @@ export async function directQuickSwapForSubmit(params) {
|
|
|
427
427
|
const primarySellTxs = sellResult.transactions.filter(tx => tx.from.toLowerCase() === primarySellerAddress);
|
|
428
428
|
let primaryNextNonce = primarySellTxs.length > 0
|
|
429
429
|
? Math.max(...primarySellTxs.map(tx => tx.nonce)) + 1
|
|
430
|
-
: await primarySellerWallet.getNonce();
|
|
430
|
+
: await primarySellerWallet.getNonce('pending');
|
|
431
431
|
const gasForBuy = 300000n * maxFeePerGas;
|
|
432
432
|
const hopGasFee = NATIVE_TRANSFER_GAS_LIMIT * maxFeePerGas;
|
|
433
433
|
const totalFlow = params.buyAmounts.reduce((sum, a) => sum + a, 0n);
|
|
@@ -505,7 +505,7 @@ export async function directQuickSwapForSubmit(params) {
|
|
|
505
505
|
const payerKey = params.buyerKeys[payerIndex] || primarySellerKey;
|
|
506
506
|
const payerAddress = new Wallet(payerKey).address.toLowerCase();
|
|
507
507
|
const payerTxs = allTxs.filter(tx => tx.from.toLowerCase() === payerAddress);
|
|
508
|
-
const payerNonce = payerTxs.length > 0 ? Math.max(...payerTxs.map(tx => tx.nonce)) + 1 : await new Wallet(payerKey, provider).getNonce();
|
|
508
|
+
const payerNonce = payerTxs.length > 0 ? Math.max(...payerTxs.map(tx => tx.nonce)) + 1 : await new Wallet(payerKey, provider).getNonce('pending');
|
|
509
509
|
const profitTx = await buildRevenueTail({
|
|
510
510
|
rpcUrl,
|
|
511
511
|
payerKey,
|
|
@@ -535,7 +535,7 @@ export async function buildProfitTransfer(params) {
|
|
|
535
535
|
const provider = new JsonRpcProvider(rpcUrl, ENI_CHAIN_ID, { staticNetwork: true });
|
|
536
536
|
const wallet = new Wallet(payerKey, provider);
|
|
537
537
|
const feeData = await provider.getFeeData();
|
|
538
|
-
const nonce = explicitNonce ?? await wallet.getNonce();
|
|
538
|
+
const nonce = explicitNonce ?? await wallet.getNonce('pending');
|
|
539
539
|
const resolvedMaxFeePerGas = maxFeePerGas ?? gasPrice ?? feeData.maxFeePerGas ?? feeData.gasPrice ?? 1000000000n;
|
|
540
540
|
const resolvedMaxPriorityFeePerGas = maxPriorityFeePerGas ?? feeData.maxPriorityFeePerGas ?? 0n;
|
|
541
541
|
const signedTx = await wallet.signTransaction({
|