diff --git a/src/config.ts b/src/config.ts index 235e70b..b66fedf 100644 --- a/src/config.ts +++ b/src/config.ts @@ -19,16 +19,17 @@ export function buildConfig(config: Record) { }); return { - hostname: config.HOSTNAME, - mercuryBackend: config.MERCURY_BACKEND, - mercuryEmail: config.AUTH_EMAIL, - mercuryGraphQL: config.MERCURY_GRAPHQL, - mercuryKey: config.MERCURY_KEY, - mercuryPassword: config.AUTH_PASS, - mercuryUserId: config.MERCURY_USER_ID, - mode: config.MODE, - redisConnectionName: config.REDIS_CONNECTION_NAME, - redisPort: Number(config.REDIS_PORT), + hostname: config.HOSTNAME || process.env.HOSTNAME!, + mercuryBackend: config.MERCURY_BACKEND || process.env.MERCURY_BACKEND!, + mercuryEmail: config.AUTH_EMAIL || process.env.AUTH_EMAIL!, + mercuryGraphQL: config.MERCURY_GRAPHQL || process.env.MERCURY_GRAPHQL!, + mercuryKey: config.MERCURY_KEY || process.env.MERCURY_KEY!, + mercuryPassword: config.AUTH_PASS || process.env.AUTH_PASS!, + mercuryUserId: config.MERCURY_USER_ID || process.env.MERCURY_USER_ID!, + mode: config.MODE || process.env.MODE!, + redisConnectionName: + config.REDIS_CONNECTION_NAME || process.env.REDIS_CONNECTION_NAME!, + redisPort: Number(config.REDIS_PORT) || Number(process.env.REDIS_PORT!), }; } diff --git a/src/service/mercury/helpers/transformers.ts b/src/service/mercury/helpers/transformers.ts index 9d9395a..e4b6771 100644 --- a/src/service/mercury/helpers/transformers.ts +++ b/src/service/mercury/helpers/transformers.ts @@ -116,9 +116,13 @@ const transformAccountBalances = async ( }, {} as NonNullable); const classicBalances = classicBalanceData.reduce((prev, curr) => { + const codeAscii = Buffer.from( + curr.assetByAsset.code.substring(2), + "hex" + ).toString("utf8"); prev[`${curr.assetByAsset.code}:${curr.assetByAsset.issuer}`] = { token: { - code: curr.assetByAsset.code, + code: codeAscii, issuer: { key: curr.assetByAsset.issuer, },