@unicitylabs/uniclaw 0.1.1 → 0.1.2

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/assets.ts +8 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unicitylabs/uniclaw",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Unicity wallet identity and encrypted DMs for OpenClaw agents — powered by Sphere SDK",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
package/src/assets.ts CHANGED
@@ -74,16 +74,18 @@ export function resolveCoinId(input: string): string | null {
74
74
  return registry.aliases.get(input.toLowerCase().trim()) ?? null;
75
75
  }
76
76
 
77
- /** Get display symbol for a faucet coin name */
78
- export function getCoinSymbol(coinName: string): string {
77
+ /** Get display symbol for a coin (accepts name, symbol, or coin id) */
78
+ export function getCoinSymbol(coin: string): string {
79
79
  const registry = loadRegistry();
80
- return registry.symbols.get(coinName) ?? coinName.toUpperCase();
80
+ const name = registry.aliases.get(coin) ?? registry.aliases.get(coin.toLowerCase()) ?? coin;
81
+ return registry.symbols.get(name) ?? coin.toUpperCase();
81
82
  }
82
83
 
83
- /** Get decimals for a faucet coin name */
84
- export function getCoinDecimals(coinName: string): number | undefined {
84
+ /** Get decimals for a coin (accepts name, symbol, or coin id) */
85
+ export function getCoinDecimals(coin: string): number | undefined {
85
86
  const registry = loadRegistry();
86
- return registry.decimals.get(coinName);
87
+ const name = registry.aliases.get(coin) ?? registry.aliases.get(coin.toLowerCase());
88
+ return name ? registry.decimals.get(name) : registry.decimals.get(coin);
87
89
  }
88
90
 
89
91
  /** Get list of all available symbols for display */