From e20860ea974c9382405b2f59f237026da6609e56 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Fri, 13 Mar 2026 14:04:17 +1100 Subject: [PATCH] fix: use base58 encoding for program_owner instead of hex Co-Authored-By: Claude Opus 4.6 --- Cargo.lock | 1 + wallet/Cargo.toml | 1 + wallet/src/helperfunctions.rs | 14 +++++++------- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 35ad429f..74fa334b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8989,6 +8989,7 @@ dependencies = [ "amm_core", "anyhow", "async-stream", + "base58", "base64 0.22.1", "borsh", "clap", diff --git a/wallet/Cargo.toml b/wallet/Cargo.toml index 95918e4b..67224047 100644 --- a/wallet/Cargo.toml +++ b/wallet/Cargo.toml @@ -21,6 +21,7 @@ humantime-serde.workspace = true humantime.workspace = true tokio = { workspace = true, features = ["macros"] } clap.workspace = true +base58.workspace = true base64.workspace = true borsh.workspace = true hex.workspace = true diff --git a/wallet/src/helperfunctions.rs b/wallet/src/helperfunctions.rs index f9ce7908..ce2b3a57 100644 --- a/wallet/src/helperfunctions.rs +++ b/wallet/src/helperfunctions.rs @@ -1,6 +1,7 @@ use std::{collections::HashMap, path::PathBuf, str::FromStr}; use anyhow::Result; +use base58::ToBase58; use key_protocol::key_protocol_core::NSSAUserData; use nssa::Account; use nssa_core::account::Nonce; @@ -155,13 +156,12 @@ pub(crate) struct HumanReadableAccount { impl From for HumanReadableAccount { fn from(account: Account) -> Self { - let program_owner = hex::encode( - account - .program_owner - .iter() - .flat_map(|n| n.to_le_bytes()) - .collect::>(), - ); + let program_owner = account + .program_owner + .iter() + .flat_map(|n| n.to_le_bytes()) + .collect::>() + .to_base58(); let data = hex::encode(account.data); Self { balance: account.balance,