@defillama/sdk 5.0.222 → 5.0.224

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/Balances.js CHANGED
@@ -58,9 +58,9 @@ class Balances {
58
58
  chain = 'ethereum';
59
59
  token = token.replace('peggy', '');
60
60
  }
61
- // add a leading 0 to the token if it's a starknet token
62
- if (!skipChain && this.chain === 'starknet' && token.length === 65) {
63
- token = token.replace('0x', '0x0');
61
+ // pad starknet token addresses back to the canonical 32 byte form
62
+ if (!skipChain && this.chain === 'starknet' && token.startsWith('0x') && token.length < 66) {
63
+ token = '0x' + token.slice(2).padStart(64, '0');
64
64
  }
65
65
  if (isUSDValue) {
66
66
  (0, generalUtil_1.sumSingleBalance)(this._usdBalances, token, balance, chain);