@peng_kai/kit 0.1.6 → 0.1.8
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.
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import isNil from 'lodash-es/isNil';
|
|
3
3
|
import isFinite from 'lodash-es/isFinite';
|
|
4
4
|
import bignumber from 'bignumber.js';
|
|
5
|
-
import {
|
|
5
|
+
import { getDependencies } from '../../../../kitDependencies';
|
|
6
6
|
|
|
7
7
|
export const paramTypes = { numberRange, datetimeRange, options };
|
|
8
8
|
|
|
@@ -23,7 +23,9 @@ function numberRange(range?: [number, number], unit?: string) {
|
|
|
23
23
|
* @param range 时间范围
|
|
24
24
|
* @param template 格式化模板(文档:https://dayjs.gitee.io/docs/zh-CN/display/format )
|
|
25
25
|
*/
|
|
26
|
-
function datetimeRange(range?: [
|
|
26
|
+
function datetimeRange(range?: [any, any], template = 'YYYY-MM-DD') {
|
|
27
|
+
const { dayjs } = getDependencies();
|
|
28
|
+
|
|
27
29
|
if (!range?.every(v => dayjs(v).isValid()))
|
|
28
30
|
return '';
|
|
29
31
|
|
package/package.json
CHANGED
package/utils/index.ts
CHANGED
|
@@ -73,30 +73,31 @@ export function getScanBrowser(chain: string, hash: string, type: 'transaction'
|
|
|
73
73
|
const _chain = chain.toUpperCase();
|
|
74
74
|
const evmType = () => type === 'transaction' ? 'tx' : type;
|
|
75
75
|
const urlFn = {
|
|
76
|
-
TRON: () => `https://tronscan.org/#/${type}/${hash}`,
|
|
77
|
-
ETH: () => `https://etherscan.io/${evmType()}/${hash}`,
|
|
78
|
-
ETHEREUM: () => `https://etherscan.io/${evmType()}/${hash}`,
|
|
79
|
-
BSC: () => `https://bscscan.com/${evmType()}/${hash}`,
|
|
80
|
-
BINANCE: () => `https://bscscan.com/${evmType()}/${hash}`,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
76
|
+
'TRON': () => `https://tronscan.org/#/${type}/${hash}`,
|
|
77
|
+
'ETH': () => `https://etherscan.io/${evmType()}/${hash}`,
|
|
78
|
+
'ETHEREUM': () => `https://etherscan.io/${evmType()}/${hash}`,
|
|
79
|
+
'BSC': () => `https://bscscan.com/${evmType()}/${hash}`,
|
|
80
|
+
'BINANCE': () => `https://bscscan.com/${evmType()}/${hash}`,
|
|
81
|
+
'BNB Chain': () => `https://bscscan.com/${evmType()}/${hash}`,
|
|
82
|
+
'BASE': () => `https://basescan.org/${evmType()}/${hash}`,
|
|
83
|
+
'HECO': () => `https://hecoscan.io/#/${evmType}/${hash}`,
|
|
84
|
+
'POLYGON': () => `https://polygonscan.com/${evmType()}/${hash}`,
|
|
85
|
+
'OKEXCHAIN': () => `https://www.okx.com/cn/explorer/oktc/${evmType()}/${hash}`,
|
|
86
|
+
'OPBNB': () => `https://opbnbscan.com/${evmType()}/${hash}`,
|
|
87
|
+
'APOTS': () => {
|
|
87
88
|
const _type = (<TypeMap>{ transaction: 'txn', address: 'account' })[type] ?? type;
|
|
88
89
|
return `https://explorer.aptoslabs.com/${_type}/${hash}`;
|
|
89
90
|
},
|
|
90
|
-
ARBITRUM: () => `https://arbiscan.io/${evmType()}/${hash}`,
|
|
91
|
-
AVALANCHE: () => `https://subnets.avax.network/c-chain/${evmType()}/${hash}`,
|
|
92
|
-
FANTOM: () => `https://ftmscan.com/${evmType()}/${hash}`,
|
|
93
|
-
OPTIMISM: () => `https://optimistic.etherscan.io/${evmType()}/${hash}`,
|
|
94
|
-
SUI: () => {
|
|
91
|
+
'ARBITRUM': () => `https://arbiscan.io/${evmType()}/${hash}`,
|
|
92
|
+
'AVALANCHE': () => `https://subnets.avax.network/c-chain/${evmType()}/${hash}`,
|
|
93
|
+
'FANTOM': () => `https://ftmscan.com/${evmType()}/${hash}`,
|
|
94
|
+
'OPTIMISM': () => `https://optimistic.etherscan.io/${evmType()}/${hash}`,
|
|
95
|
+
'SUI': () => {
|
|
95
96
|
const _type = (<TypeMap>{ transaction: 'txblock' })[type] ?? type;
|
|
96
97
|
return `https://suiexplorer.com/${_type}/${hash}`;
|
|
97
98
|
},
|
|
98
|
-
ZKSYNC: () => `https://explorer.zksync.io/${evmType()}/${hash}`,
|
|
99
|
-
SOLANA: () => {
|
|
99
|
+
'ZKSYNC': () => `https://explorer.zksync.io/${evmType()}/${hash}`,
|
|
100
|
+
'SOLANA': () => {
|
|
100
101
|
const _type = (<TypeMap>{ address: 'account' })[type] ?? type;
|
|
101
102
|
return `https://solscan.io/${_type}/${hash}`;
|
|
102
103
|
},
|