Skip to content

Commit b65a0b2

Browse files
authored
Merge pull request #2048 from oasisprotocol/lw/rm-base64
Remove base64-arraybuffer
2 parents 8755228 + a388e51 commit b65a0b2

4 files changed

Lines changed: 4 additions & 10 deletions

File tree

.changelog/2048.trivial.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove base64-arraybuffer

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
"@oasisprotocol/ionic-ledger-hw-transport-ble": "6.0.0",
7474
"@oasisprotocol/ledger": "1.0.0",
7575
"@reduxjs/toolkit": "1.9.7",
76-
"base64-arraybuffer": "1.0.2",
7776
"bignumber.js": "9.1.2",
7877
"bip39": "3.1.0",
7978
"body-scroll-lock": "4.0.0-beta.0",

src/app/lib/helpers.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
import { quantity, staking, types } from '@oasisprotocol/client'
2-
import { decode as base64decode, encode as base64encode } from 'base64-arraybuffer'
1+
import { misc, quantity, staking, types } from '@oasisprotocol/client'
32
import BigNumber from 'bignumber.js'
43
import { StringifiedBigInt } from 'types/StringifiedBigInt'
54
import { consensusDecimals, type ParaTimeConfig } from '../../config'
65

76
export const uint2hex = (uint: Uint8Array) => Buffer.from(uint).toString('hex')
87
export const hex2uint = (hex: string) => new Uint8Array(Buffer.from(hex, 'hex'))
9-
export const base64ToUint = (value: string) => new Uint8Array(base64decode(value))
10-
export const uintToBase64 = (value: Uint8Array) => base64encode(value)
8+
export const base64ToUint = (value: string) => misc.fromBase64(value)
9+
export const uintToBase64 = (value: Uint8Array) => misc.toBase64(value)
1110

1211
export const shortPublicKey = async (publicKey: Uint8Array) => {
1312
return await staking.addressFromPublicKey(publicKey)

yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3945,11 +3945,6 @@ base-x@^3.0.8:
39453945
dependencies:
39463946
safe-buffer "^5.0.1"
39473947

3948-
base64-arraybuffer@1.0.2:
3949-
version "1.0.2"
3950-
resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz#1c37589a7c4b0746e34bd1feb951da2df01c1bdc"
3951-
integrity sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==
3952-
39533948
base64-js@^1.3.1, base64-js@^1.5.1:
39543949
version "1.5.1"
39553950
resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz"

0 commit comments

Comments
 (0)