-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.ts
More file actions
151 lines (124 loc) · 5.25 KB
/
script.ts
File metadata and controls
151 lines (124 loc) · 5.25 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
import { IDexSwap, IIndexFund, ILiquidity, Securo } from "./src"
async function main() {
// const test = new Securo("13fb9206-933d-4d68-Ad93-E28ad94eca74", "38199f608ff20edf91530990f9796c90c188d12aabcfb252d086082dd4e1a683");
// test.sandboxMode();
const test = new Securo("6baf9e9d-afa6-4985-abbb-d298b6611953", "db32293d5d35fe83f390c8eac09c6c157b746109a1fca40023188b5cd6621dc6");
test.maintenanceMode();
// const prod = await test.indexFund.getPriceOf("MWI")
// console.log(prod)
// const body: IIndexFund = {
// product: "LCI",
// type: "deposit",
// amount: "1",
// userEmail: "leeyondking1997@hotmail.com",
// successURL: "http://localhost:3000/complete",
// cancelURL: "http://localhost:3000/"
// };
// const fund = await test.indexFund.createSession(body)
// console.log(fund)
// const price = await test.indexFund.getPriceOf("LCI");
// console.log(price)
// const pool = await test.indexFund.getPoolValueOf("BNI");
// console.log(pool)
// const WBTCtokenPrice = await test.dexSwap.getTokenPrice('WBTC');
// console.log(WBTCtokenPrice)
// const tokenAddress = await test.dexSwap.getTokenAddress(5, 'ETH');
// console.log(tokenAddress)
// const estimate = await test.dexSwap.getEstimatedSwap("goerli", "WBTC", "USDC", "0.01");
// console.log(estimate)
// const lpAmount = await test.dexSwap.getLiquidity("goerli", "WBTC", "USDC", 0.01);
// console.log(lpAmount)
// const fund = await test.dexSwap.getTokenAddress(5,"ETH")
// console.log(fund)
// try {
// const body: IDexSwap = {
// tokenIn :"USDC",
// tokenOut: "WBTC",
// amount: "100",
// chain:"optimismTestnet",
// isNative: false,
// slippagePercentage: "5",
// exactIn: true,
// userEmail: "leeyondking1997@hotmail.com",
// successURL: "https://google.com",
// cancelURL: "https://google.com"
// };
// const fund = await test.dexSwap.createSwapSession(body)
// console.log(fund)
// } catch (error) {
// console.log(error)
// }
try {
const body: ILiquidity = {
"pair":"WBTC-USDC",
"amount0": "0.001",
"amount1": "67.717571",
"chain": "fuji",
"isNative": false,
"addLiquidity": true,
"userEmail": "morganlyk97@gmail.com",
"successURL": "https://google.com",
"cancelURL": "https://google.com"
};
const addLiquidity = await test.dexSwap.createLiquiditySession(body)
console.log(addLiquidity)
} catch (error) {
console.log(error)
}
// const allSessions = await test.getSession();
// console.log(allSessions)
// const oneSessions = await test.getSession("VTJGc2RHVmtYMSt2SEFlcUNzWHppRzNhNW1XQTdSa25mQUN5ZjVkNW4zZ2xWNUdRUTFpQWZDWlJLc3ZOQXpkag==");
// console.log(oneSessions)
// const expireSession = await test.expireSession("VTJGc2RHVmtYMSt2SEFlcUNzWHppRzNhNW1XQTdSa25mQUN5ZjVkNW4zZ2xWNUdRUTFpQWZDWlJLc3ZOQXpkag==");
// console.log(expireSession)
// const getPaymentCountries = await test.fiatToCrypto.getPaymentCountries();
// console.log(getPaymentCountries)
// const getPaymentCryptoCurrencies = await test.fiatToCrypto.getPaymentCryptoCurrencies();
// console.log(getPaymentCryptoCurrencies)
// const getFiatCurrencies = await test.fiatToCrypto.getFiatCurrencies();
// console.log(getFiatCurrencies)
// const getEstimatedCurrencyRate = await test.fiatToCrypto.getEstimatedCurrencyRate(
// {
// cryptoAmount: 1,
// fiatAmount: 2,
// cryptoCurrency: "ETH",
// fiatCurrency: "USD",
// isBuyOrSell: "BUY",
// network: "ethereum",
// paymentMethod: "credit_debit_card"
// }
// );
// console.log(getEstimatedCurrencyRate)
// try {
// const createPaymentRequest = await test.fiatToCrypto.createPaymentRequest(
// {
// network: "solanass",
// walletAddress: "0xC6c1663165A4CC686569ceEE4795FF34598713e7",
// emailAddress: "leeyondking1997@hotmail.com",
// trxType: "Buy",
// fiatCurrency: "SGD",
// fiatAmount: 41,
// cryptoCurrency: "SOL",
// redirectURL: "https://google.com",
// isDisableCrypto: false,
// cancellationUrl: "https://youtube.com",
// paymentMethod: "credit_debit_card"
// }
// );
// console.log(createPaymentRequest)
// } catch (error) {
// console.log(error)
// }
// const expirePaymentRequest = await test.fiatToCrypto.expirePaymentRequest("9261-305274-8667");
// console.log(expirePaymentRequest)
// const getPaymentHistory = await test.fiatToCrypto.getPaymentHistory({
// txType: "Buy",
// fiatCurrency: "SGD",
// status: ["success", "void"]
// });
// console.log(getPaymentHistory)
// test.sandboxMode();
// const getByInvoiceId = await test.fiatToCrypto.getByInvoiceId("9261-305274-8667");
// console.log(getByInvoiceId)
}
main()