Skip to content

Commit

Permalink
Merge pull request #28 from dcSpark/nico/fix_tangleswap_djed_cache_issue
Browse files Browse the repository at this point in the history
Nico/fix tangleswap djed cache issue
  • Loading branch information
nicarq authored Dec 18, 2023
2 parents f9b12a6 + 82d6ef0 commit fe0ba6c
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 18 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/actor-webpage/.env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
REACT_APP_WSC_ORACLE=https://wsc-server-devnet.c1.milkomeda.com/
REACT_APP_JSON_RPC_PROVIDER_URL=https://rpc-devnet-cardano-evm.c1.milkomeda.com
12 changes: 1 addition & 11 deletions packages/actor-webpage/dist/index.html
Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>WSC Actor Webpage</title>
</head>
<body>
<div id="root"></div>
<script src="bundle.js"></script>
</body>
</html>
<!doctype html><html><head><meta charset="utf-8"/><title>WSC Actor Webpage</title><script defer="defer" src="bundle.js"></script></head><body><div id="root"></div></body></html>
4 changes: 2 additions & 2 deletions packages/milkomeda-wsc-ui-next-example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/milkomeda-wsc-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"detect-browser": "^5.3.0",
"framer-motion": "^6.3.11",
"lucide-react": "^0.252.0",
"milkomeda-wsc": "0.3.3",
"milkomeda-wsc": "0.3.5",
"qrcode": "^1.5.0",
"react": "17.x || 18.x",
"react-confetti": "^6.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/milkomeda-wsc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "milkomeda-wsc",
"version": "0.3.1",
"version": "0.3.5",
"license": "MIT",
"description": "A Typescript library to easily interact with Milkomeda's Wrapped Smart Contracts (WSC)",
"author": "nicarq",
Expand Down
19 changes: 18 additions & 1 deletion packages/milkomeda-wsc/src/BridgeActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,31 @@ class BridgeActions {
const amount = ethers.utils.parseUnits(amountToUnwrap.toString(), 18);
const adaFee = new BigNumber(this.stargateGeneric.stargateNativeTokenFeeToL1());
const adaAmount = amountToUnwrap.plus(adaFee);
{
const txRequest = {
to: this.bridgeAddress,
data: bridgeContract.interface.encodeFunctionData("submitUnwrappingRequest", [
{
assetId: ethers.constants.HashZero,
from: await signer.getAddress(),
to: l1Destination,
amount: amount.toString(),
},
]),
value: ethers.utils.parseUnits(adaAmount.toString(), 18),
};

await signer.estimateGas(txRequest);
await this.provider.getGasPrice();
}
const tx = await bridgeContract.connect(signer).submitUnwrappingRequest(
{
assetId: ethers.constants.HashZero,
from: await signer.getAddress(),
to: l1Destination,
amount: amount.toString(),
},
{ gasLimit: 1_000_000, value: ethers.utils.parseUnits(adaAmount.toString(), 18) }
{ gasLimit: 500_000, value: ethers.utils.parseUnits(adaAmount.toString(), 18) }
);

console.log("Unwrapping ADA");
Expand Down

0 comments on commit fe0ba6c

Please sign in to comment.