From 30b3c261d17cad88988ea1e008091862fdb41531 Mon Sep 17 00:00:00 2001 From: Samuel Golland Date: Tue, 11 Aug 2026 12:09:51 -0400 Subject: [PATCH 1/2] feat: add xrpl support to pk entropyToBytes --- src/lib/wallet-entropy.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/wallet-entropy.ts b/src/lib/wallet-entropy.ts index f897ba8e..9bd971cc 100644 --- a/src/lib/wallet-entropy.ts +++ b/src/lib/wallet-entropy.ts @@ -4,7 +4,7 @@ import { PrivyAPIError } from '../error'; export interface EntropyToBytesInput { entropy: string | Uint8Array; entropyType: 'hd' | 'private-key'; - chainType: 'ethereum' | 'solana' | 'stellar' | 'tron' | 'sui' | 'aptos'; + chainType: 'ethereum' | 'solana' | 'stellar' | 'tron' | 'sui' | 'aptos' | 'xrpl'; } export function entropyToBytes(wallet: EntropyToBytesInput): Uint8Array { @@ -19,7 +19,7 @@ export function entropyToBytes(wallet: EntropyToBytesInput): Uint8Array { // HD entropy is a BIP39 mnemonic that can be encoded as utf-8 return new TextEncoder().encode(entropy); case 'private-key': { - if (chainType === 'ethereum' || chainType === 'tron' || chainType === 'sui' || chainType === 'aptos') { + if (chainType === 'ethereum' || chainType === 'tron' || chainType === 'sui' || chainType === 'aptos' || chainType === 'xrpl') { try { // Private key strings are hex encoded for Ethereum const entropyWithout0x = entropy.startsWith('0x') ? entropy.slice(2) : entropy; From 2927aedeb249f461a3bb4420cb5525c9c7bfff6d Mon Sep 17 00:00:00 2001 From: Samuel Golland Date: Tue, 11 Aug 2026 12:14:20 -0400 Subject: [PATCH 2/2] fix: lint --- src/lib/wallet-entropy.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/wallet-entropy.ts b/src/lib/wallet-entropy.ts index 9bd971cc..a86bdd5d 100644 --- a/src/lib/wallet-entropy.ts +++ b/src/lib/wallet-entropy.ts @@ -19,7 +19,13 @@ export function entropyToBytes(wallet: EntropyToBytesInput): Uint8Array { // HD entropy is a BIP39 mnemonic that can be encoded as utf-8 return new TextEncoder().encode(entropy); case 'private-key': { - if (chainType === 'ethereum' || chainType === 'tron' || chainType === 'sui' || chainType === 'aptos' || chainType === 'xrpl') { + if ( + chainType === 'ethereum' || + chainType === 'tron' || + chainType === 'sui' || + chainType === 'aptos' || + chainType === 'xrpl' + ) { try { // Private key strings are hex encoded for Ethereum const entropyWithout0x = entropy.startsWith('0x') ? entropy.slice(2) : entropy;