@icgio/icg-utils 1.7.63 → 1.7.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -178,6 +178,134 @@ let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type, source = 'coingecko
178
178
  }
179
179
  cb(result)
180
180
  })
181
+ } else if (type === 'curs_dict') {
182
+ let curs_dict = pair_or_pairs_or_cur_curs
183
+ let length = _.keys(curs_dict).length
184
+ for (let cur in curs_dict) {
185
+ let exchange = curs_dict[cur]
186
+ if (exchange === 'mexc') {
187
+ let pair = cur + '_USDT'
188
+ let url = `https://www.mexc.com/open/api/v2/market/depth?symbol=${pair}&depth=100`
189
+ limiter.process(needle.get, url, (err, res, body) => {
190
+ try {
191
+ const { asks, bids } = body.data
192
+ let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
193
+ result[cur] = {
194
+ USD: rate,
195
+ USDT: rate,
196
+ }
197
+ let result_length = _.keys(result).length
198
+ if (result_length === length) {
199
+ for (let stable of stablecoins) {
200
+ result[stable] = {
201
+ USD: 1,
202
+ USDT: 1,
203
+ }
204
+ }
205
+ cb(result)
206
+ }
207
+ } catch (error) {
208
+ console.error(error)
209
+ }
210
+ })
211
+ } else if (exchange === 'gate') {
212
+ let pair = cur + '_USDT'
213
+ let url = `https://api.gateio.ws/api/v4/spot/order_book?currency_pair=${pair}`
214
+ limiter.process(needle.get, url, (err, res, body) => {
215
+ try {
216
+ const { asks, bids } = body
217
+ let rate = (parseFloat(asks[0][0]) + parseFloat(bids[0][0])) / 2
218
+ result[cur] = {
219
+ USD: rate,
220
+ USDT: rate,
221
+ }
222
+ let result_length = _.keys(result).length
223
+ if (result_length === length) {
224
+ for (let stable of stablecoins) {
225
+ result[stable] = {
226
+ USD: 1,
227
+ USDT: 1,
228
+ }
229
+ }
230
+ cb(result)
231
+ }
232
+ } catch (error) {
233
+ console.error(error)
234
+ }
235
+ })
236
+ } else if (exchange === 'bitforex') {
237
+ } else if (exchange === 'coinstore') {
238
+ let pair = cur.toLowerCase() + 'usdt'
239
+ let url = `https://api.coinstore.com/api/v1/market/depth/${pair}`
240
+ limiter.process(needle.get, url, (err, res, body) => {
241
+ try {
242
+ const asks = body.data.a
243
+ const bids = body.data.b
244
+ let rate = (parseFloat(asks[0][0]) + parseFloat(bids[0][0])) / 2
245
+ result[cur] = {
246
+ USD: rate,
247
+ USDT: rate,
248
+ }
249
+ let result_length = _.keys(result).length
250
+ if (result_length === length) {
251
+ for (let stable of stablecoins) {
252
+ result[stable] = {
253
+ USD: 1,
254
+ USDT: 1,
255
+ }
256
+ }
257
+ cb(result)
258
+ }
259
+ } catch (error) {
260
+ console.error(error)
261
+ }
262
+ })
263
+ } else if (exchange === 'xt') {
264
+ let pair = cur.toLowerCase() + '_usdt'
265
+ let url = `https://sapi.xt.com/v4/public/depth?symbol=${pair}&limit=20`
266
+ limiter.process(needle.get, url, (err, res, body) => {
267
+ try {
268
+ const asks = body.result.asks
269
+ const bids = body.result.bids
270
+ let rate = (parseFloat(asks[0][0]) + parseFloat(bids[0][0])) / 2
271
+ result[cur] = {
272
+ USD: rate,
273
+ USDT: rate,
274
+ }
275
+ let result_length = _.keys(result).length
276
+ if (result_length === length) {
277
+ for (let stable of stablecoins) {
278
+ result[stable] = {
279
+ USD: 1,
280
+ USDT: 1,
281
+ }
282
+ }
283
+ cb(result)
284
+ }
285
+ } catch (error) {
286
+ console.error(error)
287
+ }
288
+ })
289
+ } else if (exchange === 'pancakeswap') {
290
+ let pair = cur + 'USDT'
291
+ dex_rate(pair).then((res) => {
292
+ result[cur] = {
293
+ USD: res[pair],
294
+ USDT: res[pair],
295
+ }
296
+ let result_length = _.keys(result).length
297
+ if (result_length === length) {
298
+ for (let stable of stablecoins) {
299
+ result[stable] = {
300
+ USD: 1,
301
+ USDT: 1,
302
+ }
303
+ }
304
+ cb(result)
305
+ }
306
+ })
307
+ }
308
+ }
181
309
  } else {
182
310
  let quote_cur = 'USD',
183
311
  page = 1,
@@ -189,10 +317,10 @@ let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type, source = 'coingecko
189
317
  if (body && body.length > 0) {
190
318
  for (let coin of body) {
191
319
  let symbol = coin.symbol
192
- if (!symbol || !coin.current_price) continue
193
-
320
+ if (!symbol || !coin.current_price) {
321
+ continue
322
+ }
194
323
  symbol = symbol.toUpperCase()
195
-
196
324
  if (symbol === 'BAT' && coin.id !== 'basic-attention-token') {
197
325
  continue
198
326
  } else if (symbol === 'SBTC' && coin.id !== 'super-bitcoin') {
@@ -236,269 +364,31 @@ let get_crypto_rates = (cb, pair_or_pairs_or_cur_curs, type, source = 'coingecko
236
364
  }
237
365
  }
238
366
  coins_map = source === 'coingecko' ? process_coins_map_coingecko(coins_map_raw_coingecko) : process_coins_map_coinmarketcap(coins_map_raw_coinmarketcap)
239
- if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'BBDC')) {
240
- let curs = _.without(pair_or_pairs_or_cur_curs, 'BBDC')
241
- needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=BBDC_USDT&depth=100').then((res) => {
242
- try {
243
- const { asks, bids } = res.body.data
244
- let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
245
- result.BBDC = {
246
- USD: rate,
247
- USDT: rate,
248
- }
249
- get_crypto_rates(cb, curs, type, source)
250
- } catch (error) {
251
- console.error(error)
252
- }
253
- })
254
- } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'DARK')) {
255
- let curs = _.without(pair_or_pairs_or_cur_curs, 'DARK')
256
- needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=DARK_USDT&depth=100').then((res) => {
257
- try {
258
- const { asks, bids } = res.body.data
259
- let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
260
- result.DARK = {
261
- USD: rate,
262
- USDT: rate,
263
- }
264
- get_crypto_rates(cb, curs, type, source)
265
- } catch (error) {
266
- console.error(error)
267
- }
268
- })
269
- } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'DMC')) {
270
- let curs = _.without(pair_or_pairs_or_cur_curs, 'DMC')
271
- needle('get', 'https://api.gateio.ws/api/v4/spot/order_book?currency_pair=DMC_USDT').then((res) => {
272
- try {
273
- const { asks, bids } = res.body
274
- let rate = (parseFloat(asks[0][0]) + parseFloat(bids[0][0])) / 2
275
- result.DMC = {
276
- USD: rate,
277
- USDT: rate,
278
- }
279
- get_crypto_rates(cb, curs, type, source)
280
- } catch (error) {
281
- console.error(error)
282
- }
283
- })
284
- } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'DFI')) {
285
- let curs = _.without(pair_or_pairs_or_cur_curs, 'DFI')
286
- needle('get', 'https://api.coinstore.com/api/v1/market/depth/dfiusdt').then((res) => {
287
- try {
288
- const asks = res.body.data.a
289
- const bids = res.body.data.b
290
- let rate = (parseFloat(asks[0][0]) + parseFloat(bids[0][0])) / 2
291
- result.DFI = {
292
- USD: rate,
293
- USDT: rate,
294
- }
295
- get_crypto_rates(cb, curs, type, source)
296
- } catch (error) {
297
- console.error(error)
298
- }
299
- })
300
- } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'ENIX')) {
301
- let curs = _.without(pair_or_pairs_or_cur_curs, 'ENIX')
302
- needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=ENIX_USDT&depth=100').then((res) => {
303
- try {
304
- const { asks, bids } = res.body.data
305
- let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
306
- result.ENIX = {
307
- USD: rate,
308
- USDT: rate,
309
- }
310
- get_crypto_rates(cb, curs, type, source)
311
- } catch (error) {
312
- console.error(error)
313
- }
314
- })
315
- } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'FREN')) {
316
- let curs = _.without(pair_or_pairs_or_cur_curs, 'FREN')
317
- dex_rate().then((res) => {
318
- result.FREN = {
319
- USD: res.FRENUSDT,
320
- USDT: res.FRENUSDT,
321
- }
322
- get_crypto_rates(cb, curs, type, source)
323
- })
324
- } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'GLW')) {
325
- let curs = _.without(pair_or_pairs_or_cur_curs, 'GLW')
326
- needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=GLW_USDT&depth=100').then((res) => {
327
- try {
328
- const { asks, bids } = res.body.data
329
- let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
330
- result.GLW = {
331
- USD: rate,
332
- USDT: rate,
333
- }
334
- get_crypto_rates(cb, curs, type, source)
335
- } catch (error) {
336
- console.error(error)
337
- }
338
- })
339
- } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'GPT')) {
340
- let curs = _.without(pair_or_pairs_or_cur_curs, 'GPT')
341
- needle('get', 'https://api.coinstore.com/api/v1/market/depth/gptusdt').then((res) => {
342
- try {
343
- const asks = res.body.data.a
344
- const bids = res.body.data.b
345
- let rate = parseFloat(asks[0][0])
346
- result.GPT = {
347
- USD: rate,
348
- USDT: rate,
349
- }
350
- get_crypto_rates(cb, curs, type, source)
351
- } catch (error) {
352
- console.error(error)
353
- }
354
- })
355
- } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'IUS')) {
356
- let curs = _.without(pair_or_pairs_or_cur_curs, 'IUS')
357
- needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=IUS_USDT&depth=100').then((res) => {
358
- try {
359
- const { asks, bids } = res.body.data
360
- let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
361
- result.IUS = {
362
- USD: rate,
363
- USDT: rate,
364
- }
365
- get_crypto_rates(cb, curs, type, source)
366
- } catch (error) {
367
- console.error(error)
368
- }
369
- })
370
- } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'JD')) {
371
- let curs = _.without(pair_or_pairs_or_cur_curs, 'JD')
372
- needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=JD_USDT&depth=100').then((res) => {
373
- try {
374
- const { asks, bids } = res.body.data
375
- let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
376
- result.JD = {
377
- USD: rate,
378
- USDT: rate,
379
- }
380
- get_crypto_rates(cb, curs, type, source)
381
- } catch (error) {
382
- console.error(error)
383
- }
384
- })
385
- } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'KLC')) {
386
- let curs = _.without(pair_or_pairs_or_cur_curs, 'KLC')
387
- needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=KLC_USDT&depth=100').then((res) => {
388
- try {
389
- const { asks, bids } = res.body.data
390
- let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
391
- result.KLC = {
392
- USD: rate,
393
- USDT: rate,
394
- }
395
- get_crypto_rates(cb, curs, type, source)
396
- } catch (error) {
397
- console.error(error)
398
- }
399
- })
400
- } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'MEGODS')) {
401
- let curs = _.without(pair_or_pairs_or_cur_curs, 'MEGODS')
402
- needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=MEGODS_USDT&depth=100').then((res) => {
403
- try {
404
- const { asks, bids } = res.body.data
405
- let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
406
- result.MEGODS = {
407
- USD: rate,
408
- USDT: rate,
409
- }
410
- get_crypto_rates(cb, curs, type, source)
411
- } catch (error) {
412
- console.error(error)
413
- }
414
- })
415
- } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'MONE')) {
416
- let curs = _.without(pair_or_pairs_or_cur_curs, 'MONE')
417
- needle('get', 'https://www.bitforex.com/api/v1/market/depth?symbol=coin-usdt-mone').then((res) => {
418
- try {
419
- const { asks, bids } = JSON.parse(res.body).data
420
- let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
421
- result.MONE = {
422
- USD: rate,
423
- USDT: rate,
424
- }
425
- get_crypto_rates(cb, curs, type, source)
426
- } catch (error) {
427
- console.error(error)
428
- }
429
- })
430
- } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'ROACHCOIN')) {
431
- let curs = _.without(pair_or_pairs_or_cur_curs, 'ROACHCOIN')
432
- needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=ROACHCOIN_USDT&depth=100').then((res) => {
433
- try {
434
- const { asks, bids } = res.body.data
435
- let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
436
- result.ROACHCOIN = {
437
- USD: rate,
438
- USDT: rate,
439
- }
440
- get_crypto_rates(cb, curs, type, source)
441
- } catch (error) {
442
- console.error(error)
443
- }
444
- })
445
- } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'SDP')) {
446
- let curs = _.without(pair_or_pairs_or_cur_curs, 'SDP')
447
- needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=SDP_USDT&depth=100').then((res) => {
448
- try {
449
- const { asks, bids } = res.body.data
450
- let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
451
- result.SDP = {
452
- USD: rate,
453
- USDT: rate,
454
- }
455
- get_crypto_rates(cb, curs, type, source)
456
- } catch (error) {
457
- console.error(error)
458
- }
459
- })
460
- } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'SPAI')) {
461
- let curs = _.without(pair_or_pairs_or_cur_curs, 'SPAI')
462
- needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=SPAI_USDT&depth=100').then((res) => {
463
- try {
464
- const { asks, bids } = res.body.data
465
- let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
466
- result.SPAI = {
467
- USD: rate,
468
- USDT: rate,
469
- }
470
- get_crypto_rates(cb, curs, type, source)
471
- } catch (error) {
472
- console.error(error)
473
- }
474
- })
475
- } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'TIN')) {
476
- let curs = _.without(pair_or_pairs_or_cur_curs, 'TIN')
477
- needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=TIN_USDT&depth=100').then((res) => {
478
- try {
479
- const { asks, bids } = res.body.data
480
- let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
481
- result.TIN = {
482
- USD: rate,
483
- USDT: rate,
484
- }
485
- get_crypto_rates(cb, curs, type, source)
486
- } catch (error) {
487
- console.error(error)
488
- }
489
- })
490
- } else {
491
- get_crypto_rates_base(cb, pair_or_pairs_or_cur_curs, type)
492
- }
367
+ get_crypto_rates_base(cb, pair_or_pairs_or_cur_curs, type)
493
368
  }
494
369
 
370
+ // get_crypto_rates(
371
+ // (res) => {
372
+ // console.log(res)
373
+ // },
374
+ // {
375
+ // ENIX: 'mexc',
376
+ // FREN: 'pancakeswap',
377
+ // DMC: 'gate',
378
+ // XERT: 'xt',
379
+ // DFI: 'coinstore',
380
+ // },
381
+ // 'curs_dict',
382
+ // 'coinmarketcap'
383
+ // )
384
+
495
385
  // get_crypto_rates(
496
386
  // (res) => {
497
387
  // console.log(res)
498
388
  // },
499
389
  // ['BTC', 'DFI', 'ETH', 'ENIX', 'FREN', 'DMC', 'IUS', 'MONE'],
500
390
  // 'curs',
501
- // 'coingecko'
391
+ // 'coinmarketcap'
502
392
  // )
503
393
 
504
394
  // dex_rate().then((res) => {
@@ -5,18 +5,22 @@ const toBN = Web3.utils.toBN
5
5
  const web3_bsc = new Web3('https://bsc-dataseed.binance.org/')
6
6
 
7
7
  const router_abi = require('./router-abi.js')
8
- const token_abi = require('./token-abi.js')
9
8
 
10
9
  const router_contract = new web3_bsc.eth.Contract(router_abi, '0x10ED43C718714eb63d5aA57B78B54704E256024E')
11
10
  const USDT_address = '0x55d398326f99059fF775485246999027B3197955'
12
11
  const FREN_address = '0xe6a768464b042a6d029394db1fdef360cb60bbeb'
13
12
  const WBNB_address = '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c'
14
13
 
15
- let FRENUSDT_rate = async function () {
16
- let rate = _.last(await router_contract.methods.getAmountsOut(toBN(1e18), [FREN_address, WBNB_address, USDT_address]).call()) / 1e18
14
+ const routes_dict = {
15
+ FRENUSDT: [FREN_address, WBNB_address, USDT_address],
16
+ }
17
+
18
+ let dex_rate = async function (pair) {
19
+ let route = routes_dict[pair]
20
+ let rate = _.last(await router_contract.methods.getAmountsOut(toBN(1e18), route).call()) / 1e18
17
21
  return {
18
- FRENUSDT: rate,
22
+ [pair]: rate,
19
23
  }
20
24
  }
21
25
 
22
- module.exports = FRENUSDT_rate
26
+ module.exports = dex_rate
package/lib/utils.js CHANGED
@@ -27,12 +27,7 @@ const stablecoins = require('../constants/stablecoins')
27
27
  // console.log(0.000000000000000000000000001232312421.toFixed(30))
28
28
 
29
29
  Number.prototype.toStringNoExponents = function () {
30
- let data
31
- if (_.isString(this)) {
32
- data = this.split(/[eE]/)
33
- } else {
34
- data = String(this).split(/[eE]/)
35
- }
30
+ let data = String(this).split(/[eE]/)
36
31
  if (data.length == 1) {
37
32
  return data[0]
38
33
  }
@@ -58,17 +53,17 @@ Date.prototype.addHours = function (h) {
58
53
  return new Date(this.getTime() + h * 60 * 60 * 1000)
59
54
  }
60
55
 
61
- Date.prototype.roundHours = function (m) {
56
+ Date.prototype.roundHours = function (m = 1) {
62
57
  let coeff = m * 60 * 60 * 1000
63
58
  return new Date(Math.round(this.getTime() / coeff) * coeff)
64
59
  }
65
60
 
66
- Date.prototype.ceilHours = function (m) {
61
+ Date.prototype.ceilHours = function (m = 1) {
67
62
  let coeff = m * 60 * 60 * 1000
68
63
  return new Date(Math.ceil(this.getTime() / coeff) * coeff)
69
64
  }
70
65
 
71
- Date.prototype.floorHours = function (m) {
66
+ Date.prototype.floorHours = function (m = 1) {
72
67
  let coeff = m * 60 * 60 * 1000
73
68
  return new Date(Math.floor(this.getTime() / coeff) * coeff)
74
69
  }
@@ -77,17 +72,17 @@ Date.prototype.addMinutes = function (m) {
77
72
  return new Date(this.getTime() + m * 60 * 1000)
78
73
  }
79
74
 
80
- Date.prototype.roundMinutes = function (m) {
75
+ Date.prototype.roundMinutes = function (m = 1) {
81
76
  let coeff = m * 60 * 1000
82
77
  return new Date(Math.round(this.getTime() / coeff) * coeff)
83
78
  }
84
79
 
85
- Date.prototype.ceilMinutes = function (m) {
80
+ Date.prototype.ceilMinutes = function (m = 1) {
86
81
  let coeff = m * 60 * 1000
87
82
  return new Date(Math.ceil(this.getTime() / coeff) * coeff)
88
83
  }
89
84
 
90
- Date.prototype.floorMinutes = function (m) {
85
+ Date.prototype.floorMinutes = function (m = 1) {
91
86
  let coeff = m * 60 * 1000
92
87
  return new Date(Math.floor(this.getTime() / coeff) * coeff)
93
88
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icgio/icg-utils",
3
- "version": "1.7.63",
3
+ "version": "1.7.65",
4
4
  "description": "Utils package.",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -1,148 +0,0 @@
1
- module.exports = [
2
- { inputs: [], payable: false, stateMutability: 'nonpayable', type: 'constructor' },
3
- {
4
- anonymous: false,
5
- inputs: [
6
- { indexed: true, internalType: 'address', name: 'owner', type: 'address' },
7
- { indexed: true, internalType: 'address', name: 'spender', type: 'address' },
8
- { indexed: false, internalType: 'uint256', name: 'value', type: 'uint256' },
9
- ],
10
- name: 'Approval',
11
- type: 'event',
12
- },
13
- {
14
- anonymous: false,
15
- inputs: [
16
- { indexed: true, internalType: 'address', name: 'previousOwner', type: 'address' },
17
- { indexed: true, internalType: 'address', name: 'newOwner', type: 'address' },
18
- ],
19
- name: 'OwnershipTransferred',
20
- type: 'event',
21
- },
22
- {
23
- anonymous: false,
24
- inputs: [
25
- { indexed: true, internalType: 'address', name: 'from', type: 'address' },
26
- { indexed: true, internalType: 'address', name: 'to', type: 'address' },
27
- { indexed: false, internalType: 'uint256', name: 'value', type: 'uint256' },
28
- ],
29
- name: 'Transfer',
30
- type: 'event',
31
- },
32
- {
33
- constant: true,
34
- inputs: [
35
- { internalType: 'address', name: 'owner', type: 'address' },
36
- { internalType: 'address', name: 'spender', type: 'address' },
37
- ],
38
- name: 'allowance',
39
- outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
40
- payable: false,
41
- stateMutability: 'view',
42
- type: 'function',
43
- },
44
- {
45
- constant: false,
46
- inputs: [
47
- { internalType: 'address', name: 'spender', type: 'address' },
48
- { internalType: 'uint256', name: 'amount', type: 'uint256' },
49
- ],
50
- name: 'approve',
51
- outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
52
- payable: false,
53
- stateMutability: 'nonpayable',
54
- type: 'function',
55
- },
56
- {
57
- constant: true,
58
- inputs: [{ internalType: 'address', name: 'account', type: 'address' }],
59
- name: 'balanceOf',
60
- outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
61
- payable: false,
62
- stateMutability: 'view',
63
- type: 'function',
64
- },
65
- {
66
- constant: false,
67
- inputs: [{ internalType: 'uint256', name: 'amount', type: 'uint256' }],
68
- name: 'burn',
69
- outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
70
- payable: false,
71
- stateMutability: 'nonpayable',
72
- type: 'function',
73
- },
74
- { constant: true, inputs: [], name: 'decimals', outputs: [{ internalType: 'uint8', name: '', type: 'uint8' }], payable: false, stateMutability: 'view', type: 'function' },
75
- {
76
- constant: false,
77
- inputs: [
78
- { internalType: 'address', name: 'spender', type: 'address' },
79
- { internalType: 'uint256', name: 'subtractedValue', type: 'uint256' },
80
- ],
81
- name: 'decreaseAllowance',
82
- outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
83
- payable: false,
84
- stateMutability: 'nonpayable',
85
- type: 'function',
86
- },
87
- { constant: true, inputs: [], name: 'getOwner', outputs: [{ internalType: 'address', name: '', type: 'address' }], payable: false, stateMutability: 'view', type: 'function' },
88
- {
89
- constant: false,
90
- inputs: [
91
- { internalType: 'address', name: 'spender', type: 'address' },
92
- { internalType: 'uint256', name: 'addedValue', type: 'uint256' },
93
- ],
94
- name: 'increaseAllowance',
95
- outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
96
- payable: false,
97
- stateMutability: 'nonpayable',
98
- type: 'function',
99
- },
100
- {
101
- constant: false,
102
- inputs: [{ internalType: 'uint256', name: 'amount', type: 'uint256' }],
103
- name: 'mint',
104
- outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
105
- payable: false,
106
- stateMutability: 'nonpayable',
107
- type: 'function',
108
- },
109
- { constant: true, inputs: [], name: 'name', outputs: [{ internalType: 'string', name: '', type: 'string' }], payable: false, stateMutability: 'view', type: 'function' },
110
- { constant: true, inputs: [], name: 'owner', outputs: [{ internalType: 'address', name: '', type: 'address' }], payable: false, stateMutability: 'view', type: 'function' },
111
- { constant: false, inputs: [], name: 'renounceOwnership', outputs: [], payable: false, stateMutability: 'nonpayable', type: 'function' },
112
- { constant: true, inputs: [], name: 'symbol', outputs: [{ internalType: 'string', name: '', type: 'string' }], payable: false, stateMutability: 'view', type: 'function' },
113
- { constant: true, inputs: [], name: 'totalSupply', outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], payable: false, stateMutability: 'view', type: 'function' },
114
- {
115
- constant: false,
116
- inputs: [
117
- { internalType: 'address', name: 'recipient', type: 'address' },
118
- { internalType: 'uint256', name: 'amount', type: 'uint256' },
119
- ],
120
- name: 'transfer',
121
- outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
122
- payable: false,
123
- stateMutability: 'nonpayable',
124
- type: 'function',
125
- },
126
- {
127
- constant: false,
128
- inputs: [
129
- { internalType: 'address', name: 'sender', type: 'address' },
130
- { internalType: 'address', name: 'recipient', type: 'address' },
131
- { internalType: 'uint256', name: 'amount', type: 'uint256' },
132
- ],
133
- name: 'transferFrom',
134
- outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
135
- payable: false,
136
- stateMutability: 'nonpayable',
137
- type: 'function',
138
- },
139
- {
140
- constant: false,
141
- inputs: [{ internalType: 'address', name: 'newOwner', type: 'address' }],
142
- name: 'transferOwnership',
143
- outputs: [],
144
- payable: false,
145
- stateMutability: 'nonpayable',
146
- type: 'function',
147
- },
148
- ]