@signals-protocol/v1-sdk 1.4.0 → 1.4.1

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/dist/index.d.ts CHANGED
@@ -10,4 +10,4 @@ export * as MathUtils from "./utils/math";
10
10
  export { toWAD, toMicroUSDC } from "./clmsr-sdk";
11
11
  export { createCLMSRSDK, createSignalsSDK } from "./clmsr-sdk";
12
12
  export * from "./share";
13
- export declare const VERSION = "1.4.0";
13
+ export declare const VERSION = "1.4.1";
package/dist/index.js CHANGED
@@ -67,4 +67,4 @@ Object.defineProperty(exports, "createSignalsSDK", { enumerable: true, get: func
67
67
  // Share image VNode templates
68
68
  __exportStar(require("./share"), exports);
69
69
  // Version (keep in sync with package.json)
70
- exports.VERSION = "1.4.0";
70
+ exports.VERSION = "1.4.1";
@@ -184,7 +184,7 @@ function buildPositionVNode(input) {
184
184
  marginBottom: 2,
185
185
  display: "flex",
186
186
  },
187
- }, "PnL"),
187
+ }, "P&L"),
188
188
  ];
189
189
  if (hideAmounts) {
190
190
  pnlChildren.push((0, h_1.h)("div", {
@@ -100,6 +100,9 @@ function normalizePositions(positions) {
100
100
  return normalized;
101
101
  }
102
102
  function buildMainText(input) {
103
+ const handle = resolveDisplayName(input.realHandle ?? null);
104
+ if (handle)
105
+ return handle;
103
106
  if (input.hideWallet)
104
107
  return "A Signals trader";
105
108
  return resolveDisplayName(input.displayName) ?? shortenAddress(input.address);
@@ -109,7 +112,7 @@ function buildSubline(input) {
109
112
  if (input.hideWallet)
110
113
  return callCopy;
111
114
  const parts = [];
112
- if (resolveDisplayName(input.displayName) !== null) {
115
+ if (resolveDisplayName(input.realHandle ?? null) !== null) {
113
116
  parts.push(shortenAddress(input.address));
114
117
  }
115
118
  if (input.twitter) {
@@ -30,7 +30,22 @@ export interface ProfileChartPosition {
30
30
  marketEndTimestampMs: number;
31
31
  }
32
32
  export interface ProfileImageInput {
33
+ /**
34
+ * User-facing display fallback used when `realHandle` is empty and
35
+ * `hideWallet` is false. This may include an address fallback supplied by
36
+ * legacy callers; it is never shown while `hideWallet` is true.
37
+ */
33
38
  displayName: string | null;
39
+ /**
40
+ * Real, human-friendly handle (e.g. Namoshi name) that is safe to show
41
+ * even when `hideWallet` is true.
42
+ *
43
+ * Pass null when no real handle exists. Do not pass a truncated address
44
+ * fallback here; that belongs in `displayName`. Optional for backward
45
+ * compatibility, so callers that omit it get the existing hideWallet
46
+ * fallback semantics.
47
+ */
48
+ realHandle?: string | null;
34
49
  address: string;
35
50
  twitter: string | null;
36
51
  tier: "BRONZE" | "SILVER" | "GOLD" | "PLATINUM" | "DIAMOND";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signals-protocol/v1-sdk",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Signals v1 SDK for CLMSR market calculations and utilities",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -11,8 +11,6 @@
11
11
  "test": "jest",
12
12
  "test:cov": "jest --coverage",
13
13
  "test:watch": "jest --watch",
14
- "npm:auth": "node scripts/write-npmrc.js",
15
- "publish:package": "NPM_CONFIG_USERCONFIG=.npmrc.auth npm publish",
16
14
  "prepack": "yarn rebuild",
17
15
  "lint": "eslint src/**/*.ts",
18
16
  "format": "prettier --write src/**/*.ts",
@@ -38,6 +36,7 @@
38
36
  "eslint": "^8.0.0",
39
37
  "jest": "^29.5.0",
40
38
  "prettier": "^3.0.0",
39
+ "semver": "^7.7.3",
41
40
  "ts-jest": "^29.1.0",
42
41
  "typedoc": "^0.28.10",
43
42
  "typedoc-docusaurus-theme": "^1.4.2",
@@ -52,7 +51,7 @@
52
51
  ],
53
52
  "repository": {
54
53
  "type": "git",
55
- "url": "git+https://github.com/signals-protocol/signals.git"
54
+ "url": "git+https://github.com/signals-protocol/v1-sdk.git"
56
55
  },
57
56
  "exports": {
58
57
  ".": {