Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When I run this code, it does not return a hash. Additionally, regardless of whether the transaction is successful or fails, it does not enter the catch section. My code is already set up to work without transaction confirmation, but it returns an undefined response. Please help me resolve this issue. #262

Open
Deepakab56 opened this issue Sep 20, 2024 · 1 comment

Comments

@Deepakab56
Copy link

Deepakab56 commented Sep 20, 2024

const handlePresaleTonInstance = async () => {
const { evmSoftCap, evmPresaleAmount, evmHardCap, evmMinBuy, evmMaxBuy, evmStartTime, evmEndTime, evmUnsoldToken, evmWhiteList } = evmValue || {}
const get = await presaleContract?.getGetsetfee();
const message = {
$$type: "Presale",
owner: Address.parse(tonWalletAddress),
token: Address.parse("g8gYb57l5584621301D1i_AXZZLNkKcc0Y8emTvas1f8e3f0"),
fee: get,
presaleRate: evmPresaleAmount,
isWhiteListEnabled: evmWhiteList == evmWhiteListEnable ? true : false,
softcap: evmSoftCap,
hardcap: evmHardCap,
minBuy: evmMinBuy,
maxBuy: evmMaxBuy,
isRefund: evmUnsoldToken == evmUnsoldRefund ? true : false,
startTime: new Date(evmStartTime).getTime(),
endTime: new Date(evmEndTime).getTime(),
jetton: 1n,
wallet: Address.parse("g8gYb57l5584621301D1i_AXZZLNkKcc0Y8emTvas1f8e3f0"),
};

const message1 = {
  $$type: 'CreateSale',
  body: message,
};
try {
  const data = await presaleContract?.send(sender, { value: toNano("0.1"), }, message1);
  console.log("data", data);
  setTransactionLoader(false);
} catch (error) {
  console.log("ton-error", error);
  setTransactionLoader(false);
  toast.error(error.message)
};

};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@Deepakab56 and others