Skip to content

Commit 08ccb10

Browse files
authored
Merge pull request #104 from tinymanorg/fix/swap-router-app-call-note
Swap - Add origin info to app call note
2 parents 9542273 + 48c0825 commit 08ccb10

File tree

6 files changed

+17
-6
lines changed

6 files changed

+17
-6
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tinymanorg/tinyman-js-sdk",
3-
"version": "4.1.4",
3+
"version": "4.1.5",
44
"description": "Tinyman JS SDK",
55
"author": "Tinyman Core Team",
66
"license": "MIT",

src/liquid-stake/tAlgoClient.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ describe("TinymanTAlgoClient", () => {
9191
it("should calculate the mint transaction fee correctly", async () => {
9292
const result = await client.mint(mintAmount, TEST_ACCOUNT.addr);
9393

94-
expect(result[0].fee).toBe((result.length + 4) * ALGORAND_MIN_TX_FEE);
94+
expect(result[0].fee).toBe((result.length + 1) * ALGORAND_MIN_TX_FEE);
9595
});
9696

9797
it("should receive correct amount of tALGOs after mint transaction", async () => {

src/liquid-stake/tAlgoClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class TinymanTAlgoClient extends TinymanBaseClient {
5959
})
6060
];
6161

62-
return this.setupTxnFeeAndAssignGroupId({txns, additionalFeeCount: 4});
62+
return this.setupTxnFeeAndAssignGroupId({txns, additionalFeeCount: 1});
6363
}
6464

6565
async burn(amount: number, userAddress: string) {

src/swap/v2/router/swap-router.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import {
1111
SwapRouterResponse,
1212
SwapRouterTransactionRecipe
1313
} from "../../types";
14+
import {tinymanJSSDKConfig} from "../../../config";
15+
import {CONTRACT_VERSION} from "../../../contract/constants";
1416

1517
export async function generateSwapRouterTxns({
1618
initiatorAddr,
@@ -89,6 +91,15 @@ export function generateSwapRouterTxnFromRecipe(
8991
});
9092
txn.fee = 0;
9193

94+
if (
95+
recipe.args &&
96+
Buffer.from(recipe.args[0], "base64").toString("utf8") === "swap"
97+
) {
98+
txn.note = tinymanJSSDKConfig.getAppCallTxnNoteWithClientName(
99+
CONTRACT_VERSION.V2
100+
);
101+
}
102+
92103
return txn;
93104
}
94105

0 commit comments

Comments
 (0)