@depay/web3-blockchains
Advanced tools
Comparing version 4.1.0 to 4.2.0
@@ -15,4 +15,5 @@ var ethereum = { | ||
explorer: 'https://etherscan.io', | ||
explorerUrlFor: ({ transaction })=>{ | ||
explorerUrlFor: ({ transaction, token })=>{ | ||
if(transaction) { return `https://etherscan.io/tx/${transaction.id}` } | ||
if(token) { return `https://etherscan.io/token/${token}` } | ||
}, | ||
@@ -48,4 +49,5 @@ rpc: ['https://mainnet.infura.io/v3/9aa3d95b3bc4', '40fa88ea12eaa4456161'].join(''), | ||
explorer: 'https://bscscan.com', | ||
explorerUrlFor: ({ transaction })=>{ | ||
explorerUrlFor: ({ transaction, token })=>{ | ||
if(transaction) { return `https://bscscan.com/tx/${transaction.id}` } | ||
if(token) { return `https://bscscan.com/token/${token}` } | ||
}, | ||
@@ -78,4 +80,5 @@ rpc: 'https://bsc-dataseed1.binance.org', | ||
explorer: 'https://polygonscan.com', | ||
explorerUrlFor: ({ transaction })=>{ | ||
explorerUrlFor: ({ transaction, token })=>{ | ||
if(transaction) { return `https://polygonscan.com/tx/${transaction.id}` } | ||
if(token) { return `https://polygonscan.com/token/${token}` } | ||
}, | ||
@@ -82,0 +85,0 @@ rpc: 'https://rpc-mainnet.matic.network' |
@@ -21,4 +21,5 @@ (function (global, factory) { | ||
explorer: 'https://etherscan.io', | ||
explorerUrlFor: ({ transaction })=>{ | ||
explorerUrlFor: ({ transaction, token })=>{ | ||
if(transaction) { return `https://etherscan.io/tx/${transaction.id}` } | ||
if(token) { return `https://etherscan.io/token/${token}` } | ||
}, | ||
@@ -54,4 +55,5 @@ rpc: ['https://mainnet.infura.io/v3/9aa3d95b3bc4', '40fa88ea12eaa4456161'].join(''), | ||
explorer: 'https://bscscan.com', | ||
explorerUrlFor: ({ transaction })=>{ | ||
explorerUrlFor: ({ transaction, token })=>{ | ||
if(transaction) { return `https://bscscan.com/tx/${transaction.id}` } | ||
if(token) { return `https://bscscan.com/token/${token}` } | ||
}, | ||
@@ -84,4 +86,5 @@ rpc: 'https://bsc-dataseed1.binance.org', | ||
explorer: 'https://polygonscan.com', | ||
explorerUrlFor: ({ transaction })=>{ | ||
explorerUrlFor: ({ transaction, token })=>{ | ||
if(transaction) { return `https://polygonscan.com/tx/${transaction.id}` } | ||
if(token) { return `https://polygonscan.com/token/${token}` } | ||
}, | ||
@@ -88,0 +91,0 @@ rpc: 'https://rpc-mainnet.matic.network' |
{ | ||
"name": "@depay/web3-blockchains", | ||
"moduleName": "Web3Blockchains", | ||
"version": "4.1.0", | ||
"version": "4.2.0", | ||
"description": "JavaScript library containing aggregated information and abstractions for web3 blockchains.", | ||
@@ -6,0 +6,0 @@ "main": "dist/umd/index.js", |
@@ -59,3 +59,3 @@ ## Quickstart | ||
explorer: String (URL), // https://etherscan.io, https://bncscan.com, ... | ||
explorerUrlFor: Function ({ transaction (with id) }) returns String, // https://etherscan.io/tx/..., https://etherscan.io/tx/... | ||
explorerUrlFor: Function ({ transaction || token }) returns String, // https://etherscan.io/tx/..., https://etherscan.io/token/... | ||
rpc: String (URL) // ... | ||
@@ -65,2 +65,18 @@ } | ||
### explorerUrlFor | ||
#### Transaction | ||
```javascript | ||
blockchain.explorerUrlFor({ transaction: { id: '0x51ae8875028b7ed004253f679076851abbd3a49e26faf8d7dac6bb283ca10536' } }) | ||
// https://etherscan.io/tx/0x51ae8875028b7ed004253f679076851abbd3a49e26faf8d7dac6bb283ca10536 | ||
``` | ||
#### Token | ||
```javascript | ||
blockchain.explorerUrlFor({ token: '0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb' }) | ||
// https://etherscan.io/token/0xa0bEd124a09ac2Bd941b10349d8d224fe3c955eb | ||
``` | ||
## Functionalities | ||
@@ -67,0 +83,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
61126
405
146
93
8
16
2
32