File tree Expand file tree Collapse file tree 8 files changed +478
-62
lines changed Expand file tree Collapse file tree 8 files changed +478
-62
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @w3ux/hooks-source" ,
33 "license" : " GPL-3.0-only" ,
4- "version" : " 2.0.4 " ,
4+ "version" : " 2.1.0 " ,
55 "type" : " module" ,
66 "scripts" : {
77 "clear" : " rm -rf node_modules dist tsconfig.tsbuildinfo" ,
2222 "typescript" : " ^5.8.2"
2323 },
2424 "dependencies" : {
25- "@w3ux/utils" : " ^2.0.6 " ,
25+ "@w3ux/utils" : " ^2.0.8 " ,
2626 "date-fns" : " ^4.1.0"
2727 }
2828}
Original file line number Diff line number Diff line change 11{
22 "name" : " @w3ux/react-connect-kit-source" ,
33 "license" : " GPL-3.0-only" ,
4- "version" : " 3.0.5 " ,
4+ "version" : " 3.1.0 " ,
55 "type" : " module" ,
66 "scripts" : {
77 "clear" : " rm -rf node_modules dist tsconfig.tsbuildinfo" ,
88 "build" : " gulp --silent"
99 },
1010 "dependencies" : {
11- "@w3ux/extension-assets" : " ^2.1 .0" ,
11+ "@w3ux/extension-assets" : " ^2.2 .0" ,
1212 "@w3ux/hooks" : " ^2.0.4" ,
13- "@w3ux/utils" : " ^2.0.6 "
13+ "@w3ux/utils" : " ^2.0.8 "
1414 },
1515 "devDependencies" : {
1616 "@types/react" : " ^19.0.12" ,
Original file line number Diff line number Diff line change 11{
22 "name" : " @w3ux/react-polkicon-source" ,
33 "license" : " GPL-3.0-only" ,
4- "version" : " 3.0.0 " ,
4+ "version" : " 3.1.1 " ,
55 "type" : " module" ,
66 "scripts" : {
77 "clear" : " rm -rf node_modules dist tsconfig.tsbuildinfo" ,
88 "build" : " gulp --silent"
99 },
1010 "dependencies" : {
11- "@polkadot-api/substrate-bindings" : " ^0.11.1" ,
1211 "@w3ux/crypto" : " 1.0.0" ,
13- "@w3ux/utils" : " ^2.0.6"
12+ "@w3ux/utils" : " ^2.0.8" ,
13+ "dedot" : " ^0.8.1"
1414 },
1515 "devDependencies" : {
1616 "@types/react" : " ^19.0.12" ,
Original file line number Diff line number Diff line change 11/* @license Copyright 2024 w3ux authors & contributors
22SPDX-License-Identifier: GPL-3.0-only */
33
4- import { AccountId } from '@polkadot-api/substrate-bindings'
54import { blake2AsU8a } from '@w3ux/crypto'
5+ import { encodeAddress } from 'dedot/utils'
66import { PolkiconCenter , SCHEMA } from './consts'
77import type { Coordinate , Scheme } from './types'
88
@@ -141,7 +141,7 @@ const addressToId = (address: string): Uint8Array => {
141141 const zeroHash = blake2AsU8a ( new Uint8Array ( 32 ) )
142142
143143 // Get the encoded and decoded representation of the address, then hash it.
144- const pubKeyHash = blake2AsU8a ( AccountId ( ) . dec ( AccountId ( ) . enc ( address ) ) )
144+ const pubKeyHash = blake2AsU8a ( encodeAddress ( address ) )
145145
146146 // Adjust each byte in the hash relative to zeroHash and return as a Uint8Array.
147147 return pubKeyHash . map ( ( x , i ) => ( x + 256 - zeroHash [ i ] ) % 256 )
Original file line number Diff line number Diff line change 11{
22 "name" : " @w3ux/utils-source" ,
33 "license" : " GPL-3.0-only" ,
4- "version" : " 2.0.7-alpha.2 " ,
4+ "version" : " 2.0.8 " ,
55 "type" : " module" ,
66 "scripts" : {
77 "clear" : " rm -rf node_modules dist tsconfig.tsbuildinfo" ,
88 "test" : " vitest run" ,
99 "build" : " tsup src/**/* --format esm,cjs --target es2022 --dts --no-splitting"
1010 },
1111 "dependencies" : {
12- "@polkadot-api/substrate-bindings " : " ^0.11 .1"
12+ "dedot " : " ^0.8 .1"
1313 },
1414 "devDependencies" : {
1515 "@types/react" : " ^19.0.12" ,
Original file line number Diff line number Diff line change 11/* @license Copyright 2024 w3ux authors & contributors
22SPDX-License-Identifier: GPL-3.0-only */
33
4- import { AccountId } from '@polkadot-api/substrate-bindings '
4+ import { encodeAddress } from 'dedot/utils '
55
66/**
77 * Ensures a number has at least the specified number of decimal places, retaining commas in the output if they are present in the input.
@@ -231,8 +231,7 @@ export const formatAccountSs58 = (
231231 ss58Prefix : number
232232) : string | null => {
233233 try {
234- const codec = AccountId ( ss58Prefix )
235- return codec . dec ( codec . enc ( address ) )
234+ return encodeAddress ( address , ss58Prefix )
236235 } catch ( e ) {
237236 return null
238237 }
Original file line number Diff line number Diff line change 11/* @license Copyright 2024 w3ux authors & contributors
22SPDX-License-Identifier: GPL-3.0-only */
33
4- import { AccountId } from '@polkadot-api/substrate-bindings '
4+ import { decodeAddress } from 'dedot/utils '
55import type { MutableRefObject , RefObject } from 'react'
66import { rmCommas , rmDecimals } from './base'
77import type { AnyObject } from './types'
@@ -169,8 +169,7 @@ export const localStorageOrDefault = <T>(
169169 */
170170export const isValidAddress = ( address : string ) : boolean => {
171171 try {
172- const codec = AccountId ( )
173- codec . dec ( codec . enc ( address ) )
172+ decodeAddress ( address )
174173 return true
175174 } catch ( e ) {
176175 return false
You can’t perform that action at this time.
0 commit comments