depay-blockchain-token
Advanced tools
Comparing version 0.11.0 to 0.12.0
@@ -5,5 +5,10 @@ 'use strict'; | ||
var CONSTANTS = require('depay-blockchain-constants'); | ||
var depayBlockchainCall = require('depay-blockchain-call'); | ||
var ethers = require('ethers'); | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var CONSTANTS__default = /*#__PURE__*/_interopDefaultLegacy(CONSTANTS); | ||
var ERC20 = [ | ||
@@ -142,2 +147,5 @@ { | ||
async decimals() { | ||
if (this.address == CONSTANTS__default['default'][this.blockchain].NATIVE) { | ||
return CONSTANTS__default['default'][this.blockchain].DECIMALS | ||
} | ||
return await depayBlockchainCall.call({ | ||
@@ -151,2 +159,5 @@ ...this.callBasics(), | ||
async symbol() { | ||
if (this.address == CONSTANTS__default['default'][this.blockchain].NATIVE) { | ||
return CONSTANTS__default['default'][this.blockchain].SYMBOL | ||
} | ||
return await depayBlockchainCall.call({ | ||
@@ -160,2 +171,5 @@ ...this.callBasics(), | ||
async name() { | ||
if (this.address == CONSTANTS__default['default'][this.blockchain].NATIVE) { | ||
return CONSTANTS__default['default'][this.blockchain].NAME | ||
} | ||
return await depayBlockchainCall.call({ | ||
@@ -162,0 +176,0 @@ ...this.callBasics(), |
@@ -0,1 +1,2 @@ | ||
import CONSTANTS from 'depay-blockchain-constants'; | ||
import { call } from 'depay-blockchain-call'; | ||
@@ -137,2 +138,5 @@ import { ethers } from 'ethers'; | ||
async decimals() { | ||
if (this.address == CONSTANTS[this.blockchain].NATIVE) { | ||
return CONSTANTS[this.blockchain].DECIMALS | ||
} | ||
return await call({ | ||
@@ -146,2 +150,5 @@ ...this.callBasics(), | ||
async symbol() { | ||
if (this.address == CONSTANTS[this.blockchain].NATIVE) { | ||
return CONSTANTS[this.blockchain].SYMBOL | ||
} | ||
return await call({ | ||
@@ -155,2 +162,5 @@ ...this.callBasics(), | ||
async name() { | ||
if (this.address == CONSTANTS[this.blockchain].NATIVE) { | ||
return CONSTANTS[this.blockchain].NAME | ||
} | ||
return await call({ | ||
@@ -157,0 +167,0 @@ ...this.callBasics(), |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('depay-blockchain-call'), require('ethers')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'depay-blockchain-call', 'ethers'], factory) : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.BlockchainToken = {}, global.BlockchainCall, global.ethers)); | ||
}(this, (function (exports, depayBlockchainCall, ethers) { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('depay-blockchain-constants'), require('depay-blockchain-call'), require('ethers')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'depay-blockchain-constants', 'depay-blockchain-call', 'ethers'], factory) : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.BlockchainToken = {}, global.CONSTANTS, global.BlockchainCall, global.ethers)); | ||
}(this, (function (exports, CONSTANTS, depayBlockchainCall, ethers) { 'use strict'; | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var CONSTANTS__default = /*#__PURE__*/_interopDefaultLegacy(CONSTANTS); | ||
var ERC20 = [ | ||
@@ -140,2 +144,5 @@ { | ||
async decimals() { | ||
if (this.address == CONSTANTS__default['default'][this.blockchain].NATIVE) { | ||
return CONSTANTS__default['default'][this.blockchain].DECIMALS | ||
} | ||
return await depayBlockchainCall.call({ | ||
@@ -149,2 +156,5 @@ ...this.callBasics(), | ||
async symbol() { | ||
if (this.address == CONSTANTS__default['default'][this.blockchain].NATIVE) { | ||
return CONSTANTS__default['default'][this.blockchain].SYMBOL | ||
} | ||
return await depayBlockchainCall.call({ | ||
@@ -158,2 +168,5 @@ ...this.callBasics(), | ||
async name() { | ||
if (this.address == CONSTANTS__default['default'][this.blockchain].NATIVE) { | ||
return CONSTANTS__default['default'][this.blockchain].NAME | ||
} | ||
return await depayBlockchainCall.call({ | ||
@@ -160,0 +173,0 @@ ...this.callBasics(), |
{ | ||
"name": "depay-blockchain-token", | ||
"moduleName": "BlockchainToken", | ||
"version": "0.11.0", | ||
"version": "0.12.0", | ||
"description": "JavaScript library providing basic functionalities to work with tokens.", | ||
@@ -36,2 +36,3 @@ "main": "dist/cjs/index.js", | ||
"depay-blockchain-call": "^1.1.1", | ||
"depay-blockchain-constants": "^1.4.0", | ||
"ethers": "^5.3.1" | ||
@@ -38,0 +39,0 @@ }, |
18777
517
3
+ Addeddepay-blockchain-constants@1.4.0(transitive)