Skip to content

Commit c289a27

Browse files
committed
fix: entry poing error
1 parent bea4011 commit c289a27

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

bun.lockb

0 Bytes
Binary file not shown.

package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,19 @@
66
"url": "https://github.com/mytonswap"
77
},
88
"homepage": "https://docs.mytonswap.com",
9+
"contributors": [
10+
{
11+
"email": "ho3einwave@gmail.com",
12+
"name": "Ho3einWave"
13+
}
14+
],
915
"repository": {
1016
"type": "git",
1117
"url": "git+https://github.com/MyTonSwap/sdk.git"
1218
},
13-
"main": "./dist/index.js",
14-
"module": "./dist/index.mjs",
15-
"types": "./dist/index.d.ts",
19+
"main": "dist/index.js",
20+
"module": "dist/index.mjs",
21+
"types": "dist/index.d.ts",
1622
"keywords": [
1723
"MyTonSwap",
1824
"TON",

src/services/swap/swap.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class Swap extends Services {
3838
/**
3939
* swap
4040
*/
41-
public async swap(userWalletAddress: string, bestRoute: BestRoute) {
41+
public async createSwap(userWalletAddress: string, bestRoute: BestRoute) {
4242
try {
4343
switch (bestRoute.selected_pool.dex) {
4444
case 'stonfi':

src/services/swap/swap.test.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { beforeAll, beforeEach, expect, test } from 'bun:test';
1+
import { beforeEach, expect, test } from 'bun:test';
22
import { MyTonSwapClient } from '../../core/client';
33
import { toNano } from '@ton/ton';
44
import { sleep } from 'bun';
@@ -22,7 +22,7 @@ test(
2222
1,
2323
'stonfi',
2424
);
25-
const swap = await client.swap.swap(userWallet, bestRoute);
25+
const swap = await client.swap.createSwap(userWallet, bestRoute);
2626
expect(swap).toBeObject();
2727
expect(swap?.value).not.toBeUndefined();
2828
expect(swap?.value).toBeGreaterThan(toNano(1));
@@ -43,16 +43,10 @@ test(
4343
1,
4444
'dedust',
4545
);
46-
const swap = await client.swap.swap(userWallet, bestRoute);
46+
const swap = await client.swap.createSwap(userWallet, bestRoute);
4747
expect(swap).toBeObject();
4848
expect(swap?.value).not.toBeUndefined();
4949
expect(swap?.value).toBeGreaterThan(toNano(1));
5050
},
5151
{ timeout: 10000 },
5252
);
53-
54-
test('it should successfully swap tokens', async () => {
55-
const TON = await client.assets.getExactAsset('TON');
56-
const NOT = await client.assets.getExactAsset('NOT');
57-
const bestRoute = client.router.findBestRoute(TON!.address, NOT!.address, toNano(1));
58-
});

0 commit comments

Comments
 (0)