mirror of
https://github.com/d0zingcat/solana-agent-kit.git
synced 2026-06-01 07:36:46 +00:00
fix: Parse float number to BN error
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
import AmmImpl from "@mercurial-finance/dynamic-amm-sdk";
|
||||
import { SolanaAgentKit } from "../agent";
|
||||
import BN from "bn.js";
|
||||
import { PublicKey, sendAndConfirmTransaction } from "@solana/web3.js";
|
||||
import {
|
||||
ComputeBudgetProgram,
|
||||
PublicKey,
|
||||
sendAndConfirmTransaction,
|
||||
} from "@solana/web3.js";
|
||||
import { CustomizableParams } from "@mercurial-finance/dynamic-amm-sdk/dist/cjs/src/amm/types";
|
||||
|
||||
/**
|
||||
@@ -26,6 +30,7 @@ export async function createMeteoraDynamicAMMPool(
|
||||
tokenAAmount: BN,
|
||||
tokenBAmount: BN,
|
||||
customizableParams: CustomizableParams,
|
||||
computeUnitMicroLamports: number,
|
||||
): Promise<string> {
|
||||
const initPoolTx =
|
||||
await AmmImpl.createCustomizablePermissionlessConstantProductPool(
|
||||
@@ -38,6 +43,12 @@ export async function createMeteoraDynamicAMMPool(
|
||||
customizableParams,
|
||||
);
|
||||
|
||||
initPoolTx.add(
|
||||
ComputeBudgetProgram.setComputeUnitPrice({
|
||||
microLamports: computeUnitMicroLamports,
|
||||
}),
|
||||
);
|
||||
|
||||
const initPoolTxHash = await sendAndConfirmTransaction(
|
||||
agent.connection,
|
||||
initPoolTx,
|
||||
|
||||
Reference in New Issue
Block a user