@icgio/icg-utils 1.7.64 → 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,253 +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, 'IUS')) {
340
- let curs = _.without(pair_or_pairs_or_cur_curs, 'IUS')
341
- needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=IUS_USDT&depth=100').then((res) => {
342
- try {
343
- const { asks, bids } = res.body.data
344
- let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
345
- result.IUS = {
346
- USD: rate,
347
- USDT: rate,
348
- }
349
- get_crypto_rates(cb, curs, type, source)
350
- } catch (error) {
351
- console.error(error)
352
- }
353
- })
354
- } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'JD')) {
355
- let curs = _.without(pair_or_pairs_or_cur_curs, 'JD')
356
- needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=JD_USDT&depth=100').then((res) => {
357
- try {
358
- const { asks, bids } = res.body.data
359
- let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
360
- result.JD = {
361
- USD: rate,
362
- USDT: rate,
363
- }
364
- get_crypto_rates(cb, curs, type, source)
365
- } catch (error) {
366
- console.error(error)
367
- }
368
- })
369
- } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'KLC')) {
370
- let curs = _.without(pair_or_pairs_or_cur_curs, 'KLC')
371
- needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=KLC_USDT&depth=100').then((res) => {
372
- try {
373
- const { asks, bids } = res.body.data
374
- let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
375
- result.KLC = {
376
- USD: rate,
377
- USDT: rate,
378
- }
379
- get_crypto_rates(cb, curs, type, source)
380
- } catch (error) {
381
- console.error(error)
382
- }
383
- })
384
- } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'MEGODS')) {
385
- let curs = _.without(pair_or_pairs_or_cur_curs, 'MEGODS')
386
- needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=MEGODS_USDT&depth=100').then((res) => {
387
- try {
388
- const { asks, bids } = res.body.data
389
- let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
390
- result.MEGODS = {
391
- USD: rate,
392
- USDT: rate,
393
- }
394
- get_crypto_rates(cb, curs, type, source)
395
- } catch (error) {
396
- console.error(error)
397
- }
398
- })
399
- } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'MONE')) {
400
- let curs = _.without(pair_or_pairs_or_cur_curs, 'MONE')
401
- needle('get', 'https://www.bitforex.com/api/v1/market/depth?symbol=coin-usdt-mone').then((res) => {
402
- try {
403
- const { asks, bids } = JSON.parse(res.body).data
404
- let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
405
- result.MONE = {
406
- USD: rate,
407
- USDT: rate,
408
- }
409
- get_crypto_rates(cb, curs, type, source)
410
- } catch (error) {
411
- console.error(error)
412
- }
413
- })
414
- } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'ROACHCOIN')) {
415
- let curs = _.without(pair_or_pairs_or_cur_curs, 'ROACHCOIN')
416
- needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=ROACHCOIN_USDT&depth=100').then((res) => {
417
- try {
418
- const { asks, bids } = res.body.data
419
- let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
420
- result.ROACHCOIN = {
421
- USD: rate,
422
- USDT: rate,
423
- }
424
- get_crypto_rates(cb, curs, type, source)
425
- } catch (error) {
426
- console.error(error)
427
- }
428
- })
429
- } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'SDP')) {
430
- let curs = _.without(pair_or_pairs_or_cur_curs, 'SDP')
431
- needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=SDP_USDT&depth=100').then((res) => {
432
- try {
433
- const { asks, bids } = res.body.data
434
- let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
435
- result.SDP = {
436
- USD: rate,
437
- USDT: rate,
438
- }
439
- get_crypto_rates(cb, curs, type, source)
440
- } catch (error) {
441
- console.error(error)
442
- }
443
- })
444
- } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'SPAI')) {
445
- let curs = _.without(pair_or_pairs_or_cur_curs, 'SPAI')
446
- needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=SPAI_USDT&depth=100').then((res) => {
447
- try {
448
- const { asks, bids } = res.body.data
449
- let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
450
- result.SPAI = {
451
- USD: rate,
452
- USDT: rate,
453
- }
454
- get_crypto_rates(cb, curs, type, source)
455
- } catch (error) {
456
- console.error(error)
457
- }
458
- })
459
- } else if (type === 'curs' && _.includes(pair_or_pairs_or_cur_curs, 'TIN')) {
460
- let curs = _.without(pair_or_pairs_or_cur_curs, 'TIN')
461
- needle('get', 'https://www.mexc.com/open/api/v2/market/depth?symbol=TIN_USDT&depth=100').then((res) => {
462
- try {
463
- const { asks, bids } = res.body.data
464
- let rate = (parseFloat(asks[0].price) + parseFloat(bids[0].price)) / 2
465
- result.TIN = {
466
- USD: rate,
467
- USDT: rate,
468
- }
469
- get_crypto_rates(cb, curs, type, source)
470
- } catch (error) {
471
- console.error(error)
472
- }
473
- })
474
- } else {
475
- get_crypto_rates_base(cb, pair_or_pairs_or_cur_curs, type)
476
- }
367
+ get_crypto_rates_base(cb, pair_or_pairs_or_cur_curs, type)
477
368
  }
478
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
+
479
385
  // get_crypto_rates(
480
386
  // (res) => {
481
387
  // console.log(res)
482
388
  // },
483
389
  // ['BTC', 'DFI', 'ETH', 'ENIX', 'FREN', 'DMC', 'IUS', 'MONE'],
484
390
  // 'curs',
485
- // 'coingecko'
391
+ // 'coinmarketcap'
486
392
  // )
487
393
 
488
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
@@ -53,17 +53,17 @@ Date.prototype.addHours = function (h) {
53
53
  return new Date(this.getTime() + h * 60 * 60 * 1000)
54
54
  }
55
55
 
56
- Date.prototype.roundHours = function (m) {
56
+ Date.prototype.roundHours = function (m = 1) {
57
57
  let coeff = m * 60 * 60 * 1000
58
58
  return new Date(Math.round(this.getTime() / coeff) * coeff)
59
59
  }
60
60
 
61
- Date.prototype.ceilHours = function (m) {
61
+ Date.prototype.ceilHours = function (m = 1) {
62
62
  let coeff = m * 60 * 60 * 1000
63
63
  return new Date(Math.ceil(this.getTime() / coeff) * coeff)
64
64
  }
65
65
 
66
- Date.prototype.floorHours = function (m) {
66
+ Date.prototype.floorHours = function (m = 1) {
67
67
  let coeff = m * 60 * 60 * 1000
68
68
  return new Date(Math.floor(this.getTime() / coeff) * coeff)
69
69
  }
@@ -72,17 +72,17 @@ Date.prototype.addMinutes = function (m) {
72
72
  return new Date(this.getTime() + m * 60 * 1000)
73
73
  }
74
74
 
75
- Date.prototype.roundMinutes = function (m) {
75
+ Date.prototype.roundMinutes = function (m = 1) {
76
76
  let coeff = m * 60 * 1000
77
77
  return new Date(Math.round(this.getTime() / coeff) * coeff)
78
78
  }
79
79
 
80
- Date.prototype.ceilMinutes = function (m) {
80
+ Date.prototype.ceilMinutes = function (m = 1) {
81
81
  let coeff = m * 60 * 1000
82
82
  return new Date(Math.ceil(this.getTime() / coeff) * coeff)
83
83
  }
84
84
 
85
- Date.prototype.floorMinutes = function (m) {
85
+ Date.prototype.floorMinutes = function (m = 1) {
86
86
  let coeff = m * 60 * 1000
87
87
  return new Date(Math.floor(this.getTime() / coeff) * coeff)
88
88
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icgio/icg-utils",
3
- "version": "1.7.64",
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
- ]