Skip to content

Commit

Permalink
Remove base64-arraybuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaw3d committed Aug 27, 2024
1 parent 8755228 commit a388e51
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
1 change: 1 addition & 0 deletions .changelog/2048.trivial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove base64-arraybuffer
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
"@oasisprotocol/ionic-ledger-hw-transport-ble": "6.0.0",
"@oasisprotocol/ledger": "1.0.0",
"@reduxjs/toolkit": "1.9.7",
"base64-arraybuffer": "1.0.2",
"bignumber.js": "9.1.2",
"bip39": "3.1.0",
"body-scroll-lock": "4.0.0-beta.0",
Expand Down
7 changes: 3 additions & 4 deletions src/app/lib/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { quantity, staking, types } from '@oasisprotocol/client'
import { decode as base64decode, encode as base64encode } from 'base64-arraybuffer'
import { misc, quantity, staking, types } from '@oasisprotocol/client'
import BigNumber from 'bignumber.js'
import { StringifiedBigInt } from 'types/StringifiedBigInt'
import { consensusDecimals, type ParaTimeConfig } from '../../config'

export const uint2hex = (uint: Uint8Array) => Buffer.from(uint).toString('hex')
export const hex2uint = (hex: string) => new Uint8Array(Buffer.from(hex, 'hex'))
export const base64ToUint = (value: string) => new Uint8Array(base64decode(value))
export const uintToBase64 = (value: Uint8Array) => base64encode(value)
export const base64ToUint = (value: string) => misc.fromBase64(value)
export const uintToBase64 = (value: Uint8Array) => misc.toBase64(value)

export const shortPublicKey = async (publicKey: Uint8Array) => {
return await staking.addressFromPublicKey(publicKey)
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3945,11 +3945,6 @@ base-x@^3.0.8:
dependencies:
safe-buffer "^5.0.1"

[email protected]:
version "1.0.2"
resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz#1c37589a7c4b0746e34bd1feb951da2df01c1bdc"
integrity sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==

base64-js@^1.3.1, base64-js@^1.5.1:
version "1.5.1"
resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz"
Expand Down

0 comments on commit a388e51

Please sign in to comment.