-
Notifications
You must be signed in to change notification settings - Fork 0
/
swap.sh
executable file
·45 lines (39 loc) · 1.28 KB
/
swap.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
export ALICE=$(dfx --identity alice identity get-principal)
export BOB=$(dfx --identity bob identity get-principal)
export OWNER=$(dfx --identity owner identity get-principal)
echo Info Before Swapping
echo ================================================================
echo ""
eval ./scripts/getPair.sh owner core tokenA tokenB
echo ""
eval ./scripts/get-user-info.sh bob core
echo ""
echo Get Amount In
echo ================================================================
echo ""
echo "Get amount in tokenB for 300 tokenA"
eval ./scripts/getAmountIn.sh alice core tokenA tokenB 300
echo ""
echo Swap
echo ================================================================
echo ""
eval ./scripts/swap.sh bob core tokenA tokenB 300 1741447837000000000
echo ""
echo Info After Swapping
echo ================================================================
echo ""
eval ./scripts/getPair.sh owner core tokenA tokenB
echo ""
eval ./scripts/get-user-info.sh bob core
echo ""
echo Get Root Bucket ID
echo ================================================================
echo ""
eval ./scripts/get-root-bucket.sh alice router
echo ""
echo Get Transaction Info
echo ================================================================
echo ""
eval ./scripts/get-transaction.sh alice router 6
echo ""