@peng_kai/kit 0.0.11 → 0.0.12

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 @@ import { computed, h } from "vue";
2
2
  import { Tag as ATag } from 'ant-design-vue'
3
3
  import type { TagProps } from 'ant-design-vue'
4
4
 
5
- export function createTagGetter(typeMapFn: () => { [code: number]: [ text: string, color: TagProps['color'] ] }) {
5
+ export function createTagGetter(typeMapFn: () => { [code: number | string]: [ text: string, color: TagProps['color'] ] }) {
6
6
  const typeMap = computed(typeMapFn)
7
7
 
8
8
  return (type: number) => {
@@ -9,8 +9,9 @@ export function useFilterParams<R extends Api.Request, AP extends Api.GetParam<R
9
9
  buildParams: () => BP,
10
10
  pageParams = defaultPageParams,
11
11
  ) {
12
- const params = reactive({ ...pageParams, ...buildParams() } as AP & BP & PageParams)
13
- const update = (newParams?: Partial<AP>) => {
12
+ type FinalParams = AP & BP & PageParams
13
+ const params = reactive({ ...pageParams, ...buildParams() } as FinalParams)
14
+ const update = (newParams?: Partial<FinalParams>) => {
14
15
  Object.assign(params, { ...buildParams(), ...newParams })
15
16
  }
16
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peng_kai/kit",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/utils/index.ts CHANGED
@@ -50,15 +50,22 @@ export function desensitize(str: string | undefined | null, startChars = 4, endC
50
50
  * @param hash 哈希
51
51
  * @param type 哈希类型
52
52
  */
53
- export function getScanBrowser(chain: string, hash: string, type: 'block' | 'transaction' | 'address' = 'transaction') {
53
+ export function getScanBrowser(chain: string, hash: string, type: 'transaction' | 'address' = 'transaction') {
54
54
  const _chain = chain.toUpperCase()
55
55
  const evmType = type === 'transaction' ? 'tx' : type
56
- const url
57
- = {
58
- TRON: `https://${ENV.isTest ? 'nile.' : ''}tronscan.org/#/${type}/${hash}`,
59
- ETHEREUM: `https://${ENV.isTest ? 'sepolia.' : ''}etherscan.io/${evmType}/${hash}`,
60
- BINANCE: `https://${ENV.isTest ? 'testnet.' : ''}bscscan.com/${evmType}/${hash}`,
61
- }[_chain] ?? ''
56
+
57
+ const url = {
58
+ TRON: `https://tronscan.org/#/${type}/${hash}`,
59
+ ETH: `https://etherscan.io/${evmType}/${hash}`,
60
+ ETHEREUM: `https://etherscan.io/${evmType}/${hash}`,
61
+ BSC: `https://bscscan.com/${evmType}/${hash}`,
62
+ BINANCE: `https://bscscan.com/${evmType}/${hash}`,
63
+ BASE: `https://basescan.org/${type}/${hash}`,
64
+ HECO: `https://hecoscan.io/#/${type}/${hash}`,
65
+ POLYGON: `https://polygonscan.com/${type}/${hash}`,
66
+ OKEXCHAIN: `https://www.okx.com/cn/explorer/oktc/${type}/${hash}`,
67
+ OPBNB: `https://opbnbscan.com/${type}/${hash}`,
68
+ }[_chain] ?? ''
62
69
 
63
70
  return url
64
71
  }