@hsuite/native-connect-types 2.2.0 → 3.0.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.
Files changed (47) hide show
  1. package/dist/emoji-avatar.d.ts +37 -0
  2. package/dist/emoji-avatar.d.ts.map +1 -0
  3. package/dist/emoji-avatar.js +111 -0
  4. package/dist/emoji-avatar.js.map +1 -0
  5. package/dist/hedera-transfer-legs.d.ts +80 -0
  6. package/dist/hedera-transfer-legs.d.ts.map +1 -0
  7. package/dist/hedera-transfer-legs.js +95 -0
  8. package/dist/hedera-transfer-legs.js.map +1 -0
  9. package/dist/index.d.ts +5 -1
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +3 -1
  12. package/dist/index.js.map +1 -1
  13. package/dist/ledger.d.ts +20 -0
  14. package/dist/ledger.d.ts.map +1 -1
  15. package/dist/ledger.js +22 -0
  16. package/dist/ledger.js.map +1 -1
  17. package/dist/messages.d.ts +5 -0
  18. package/dist/messages.d.ts.map +1 -1
  19. package/dist/multisig-account.d.ts +41 -1
  20. package/dist/multisig-account.d.ts.map +1 -1
  21. package/dist/multisig-account.js +6 -1
  22. package/dist/multisig-account.js.map +1 -1
  23. package/dist/rpc.d.ts +7 -0
  24. package/dist/rpc.d.ts.map +1 -1
  25. package/dist/transaction-amount-utils.d.ts +88 -0
  26. package/dist/transaction-amount-utils.d.ts.map +1 -0
  27. package/dist/transaction-amount-utils.js +94 -0
  28. package/dist/transaction-amount-utils.js.map +1 -0
  29. package/dist/transaction-approval.d.ts +104 -1
  30. package/dist/transaction-approval.d.ts.map +1 -1
  31. package/dist/vault.d.ts +24 -12
  32. package/dist/vault.d.ts.map +1 -1
  33. package/dist/widget.types.d.ts +19 -2
  34. package/dist/widget.types.d.ts.map +1 -1
  35. package/dist/widget.types.js.map +1 -1
  36. package/package.json +8 -2
  37. package/src/hedera-transfer-legs.spec.ts +392 -0
  38. package/src/hedera-transfer-legs.ts +164 -0
  39. package/src/index.ts +28 -0
  40. package/src/ledger.spec.ts +44 -1
  41. package/src/ledger.ts +25 -0
  42. package/src/multisig-account.ts +25 -1
  43. package/src/transaction-amount-utils.spec.ts +184 -0
  44. package/src/transaction-amount-utils.ts +124 -0
  45. package/src/transaction-approval.ts +103 -0
  46. package/src/widget.types.ts +20 -2
  47. package/tsconfig.build.tsbuildinfo +1 -0
@@ -8,7 +8,7 @@
8
8
  * visit https://hsuite.finance/licensing
9
9
  */
10
10
  /**
11
- * @fileoverview Unified account management for singlesig and multisig accounts.
11
+ * @file Unified account management for singlesig and multisig accounts.
12
12
  *
13
13
  * This module provides a unified data model where both singlesig and multisig
14
14
  * accounts are stored together in the KeyVault. This design enables:
@@ -72,19 +72,30 @@ export declare const MultisigSignerSchema: z.ZodObject<{
72
72
  weight: z.ZodDefault<z.ZodNumber>;
73
73
  /** Whether this signer is "self" (controlled by this wallet instance) */
74
74
  isSelf: z.ZodOptional<z.ZodBoolean>;
75
+ /** Whether this row is a live on-chain key member that maps to no known account */
76
+ unresolved: z.ZodOptional<z.ZodBoolean>;
75
77
  }, "strip", z.ZodTypeAny, {
76
78
  publicKey?: string;
77
79
  label?: string;
78
80
  accountAddress?: string;
79
81
  weight?: number;
80
82
  isSelf?: boolean;
83
+ unresolved?: boolean;
81
84
  }, {
82
85
  publicKey?: string;
83
86
  label?: string;
84
87
  accountAddress?: string;
85
88
  weight?: number;
86
89
  isSelf?: boolean;
90
+ unresolved?: boolean;
87
91
  }>;
92
+ /**
93
+ * A single member of a multisig account's authorization set.
94
+ *
95
+ * Identity is ledger-dependent: Hedera surfaces `publicKey` (a ThresholdKey
96
+ * member), XRPL surfaces `accountAddress` (a SignerList entry). Either may be
97
+ * populated on its own, so comparisons must tolerate one side being empty.
98
+ */
88
99
  export interface MultisigSigner {
89
100
  /** Human-readable label for this signer (e.g., "Alice", "Treasury Hot Wallet") */
90
101
  label: string;
@@ -96,6 +107,18 @@ export interface MultisigSigner {
96
107
  weight?: number;
97
108
  /** Whether this signer is "self" (controlled by this wallet instance) */
98
109
  isSelf?: boolean;
110
+ /**
111
+ * True when this row was recovered from the account's LIVE on-chain key list
112
+ * but matches no account the wallet could resolve — e.g. a bare public key
113
+ * sitting in a Hedera `ThresholdKey` that was never assigned to an account.
114
+ *
115
+ * Such a signer can never sign (nobody holds a matching account) and has no
116
+ * address to render, but it MUST stay in the persisted signer list: a later
117
+ * policy update rebuilds the ThresholdKey from these `publicKey` values
118
+ * (`composeHederaMultisigUpdate`), so dropping the row would silently
119
+ * rewrite the account's on-chain key and hand control to a different set.
120
+ */
121
+ unresolved?: boolean;
99
122
  }
100
123
  /**
101
124
  * MultisigAccountConfig
@@ -163,18 +186,22 @@ export declare const MultisigInfoSchema: z.ZodObject<{
163
186
  weight: z.ZodDefault<z.ZodNumber>;
164
187
  /** Whether this signer is "self" (controlled by this wallet instance) */
165
188
  isSelf: z.ZodOptional<z.ZodBoolean>;
189
+ /** Whether this row is a live on-chain key member that maps to no known account */
190
+ unresolved: z.ZodOptional<z.ZodBoolean>;
166
191
  }, "strip", z.ZodTypeAny, {
167
192
  publicKey?: string;
168
193
  label?: string;
169
194
  accountAddress?: string;
170
195
  weight?: number;
171
196
  isSelf?: boolean;
197
+ unresolved?: boolean;
172
198
  }, {
173
199
  publicKey?: string;
174
200
  label?: string;
175
201
  accountAddress?: string;
176
202
  weight?: number;
177
203
  isSelf?: boolean;
204
+ unresolved?: boolean;
178
205
  }>, "many">;
179
206
  /** The address of the local signer (this wallet's signing account) */
180
207
  localSignerAddress: z.ZodOptional<z.ZodString>;
@@ -195,6 +222,7 @@ export declare const MultisigInfoSchema: z.ZodObject<{
195
222
  accountAddress?: string;
196
223
  weight?: number;
197
224
  isSelf?: boolean;
225
+ unresolved?: boolean;
198
226
  }[];
199
227
  localSignerAddress?: string;
200
228
  originalConfigId?: string;
@@ -209,6 +237,7 @@ export declare const MultisigInfoSchema: z.ZodObject<{
209
237
  accountAddress?: string;
210
238
  weight?: number;
211
239
  isSelf?: boolean;
240
+ unresolved?: boolean;
212
241
  }[];
213
242
  localSignerAddress?: string;
214
243
  originalConfigId?: string;
@@ -247,18 +276,22 @@ export declare const UnifiedAccountMetadataSchema: z.ZodObject<{
247
276
  weight: z.ZodDefault<z.ZodNumber>;
248
277
  /** Whether this signer is "self" (controlled by this wallet instance) */
249
278
  isSelf: z.ZodOptional<z.ZodBoolean>;
279
+ /** Whether this row is a live on-chain key member that maps to no known account */
280
+ unresolved: z.ZodOptional<z.ZodBoolean>;
250
281
  }, "strip", z.ZodTypeAny, {
251
282
  publicKey?: string;
252
283
  label?: string;
253
284
  accountAddress?: string;
254
285
  weight?: number;
255
286
  isSelf?: boolean;
287
+ unresolved?: boolean;
256
288
  }, {
257
289
  publicKey?: string;
258
290
  label?: string;
259
291
  accountAddress?: string;
260
292
  weight?: number;
261
293
  isSelf?: boolean;
294
+ unresolved?: boolean;
262
295
  }>, "many">;
263
296
  /** The address of the local signer (this wallet's signing account) */
264
297
  localSignerAddress: z.ZodOptional<z.ZodString>;
@@ -279,6 +312,7 @@ export declare const UnifiedAccountMetadataSchema: z.ZodObject<{
279
312
  accountAddress?: string;
280
313
  weight?: number;
281
314
  isSelf?: boolean;
315
+ unresolved?: boolean;
282
316
  }[];
283
317
  localSignerAddress?: string;
284
318
  originalConfigId?: string;
@@ -293,6 +327,7 @@ export declare const UnifiedAccountMetadataSchema: z.ZodObject<{
293
327
  accountAddress?: string;
294
328
  weight?: number;
295
329
  isSelf?: boolean;
330
+ unresolved?: boolean;
296
331
  }[];
297
332
  localSignerAddress?: string;
298
333
  originalConfigId?: string;
@@ -330,6 +365,7 @@ export declare const UnifiedAccountMetadataSchema: z.ZodObject<{
330
365
  accountAddress?: string;
331
366
  weight?: number;
332
367
  isSelf?: boolean;
368
+ unresolved?: boolean;
333
369
  }[];
334
370
  localSignerAddress?: string;
335
371
  originalConfigId?: string;
@@ -355,6 +391,7 @@ export declare const UnifiedAccountMetadataSchema: z.ZodObject<{
355
391
  accountAddress?: string;
356
392
  weight?: number;
357
393
  isSelf?: boolean;
394
+ unresolved?: boolean;
358
395
  }[];
359
396
  localSignerAddress?: string;
360
397
  originalConfigId?: string;
@@ -408,6 +445,9 @@ export declare function createMultisigMetadata(config: MultisigAccountConfig, lo
408
445
  *
409
446
  * @param existingMetadata - Current account metadata
410
447
  * @param multisigConfig - Multisig configuration to apply
448
+ * @param multisigConfig.threshold - Signatures (or summed weights) required to authorize
449
+ * @param multisigConfig.signers - Full member list, including any unresolved on-chain keys
450
+ * @param multisigConfig.name - Human-readable account label
411
451
  * @param localSignerAddress - Address of the local signer
412
452
  * @returns Updated metadata with multisig configuration
413
453
  */
@@ -1 +1 @@
1
- {"version":3,"file":"multisig-account.d.ts","sourceRoot":"","sources":["../src/multisig-account.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;;;;;;;GAQG;AACH,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,UAAU,CAAC;AAEnD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,sCAAoC,CAAC;AAMnE;;;;GAIG;AACH;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;IAC/B,2CAA2C;;IAE3C,2DAA2D;;IAE3D,+DAA+D;;IAE/D,yDAAyD;;IAEzD,yEAAyE;;;;;;;;;;;;;;EAEzE,CAAC;AAEH,MAAM,WAAW,cAAc;IAC7B,kFAAkF;IAClF,KAAK,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB,+DAA+D;IAC/D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,gEAAgE;IAChE,EA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;;;;;;;;;;;;;;;;;;;;;;;IAuBjF,yCAAyC;;IAEzC,kEAAkE;;IAElE,mEAAmE;;IAEnE,iDAAiD;;IAEjD,4BAA4B;;IAE5B,+BAA+B;;IAE/B,kDAAkD;;IAElD,iDAAiD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEjD,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAMlF;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAE7E;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,YAAY,GAAG,SAAS,CAK5F;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,qBAAqB,EAC7B,kBAAkB,CAAC,EAAE,MAAM,GAC1B,sBAAsB,CAaxB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,0BAA0B,CACxC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EACrD,cAAc,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,cAAc,EAAE,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EAC/E,kBAAkB,CAAC,EAAE,MAAM,GAC1B,sBAAsB,CAgBxB"}
@@ -8,7 +8,7 @@
8
8
  * visit https://hsuite.finance/licensing
9
9
  */
10
10
  /**
11
- * @fileoverview Unified account management for singlesig and multisig accounts.
11
+ * @file Unified account management for singlesig and multisig accounts.
12
12
  *
13
13
  * This module provides a unified data model where both singlesig and multisig
14
14
  * accounts are stored together in the KeyVault. This design enables:
@@ -65,6 +65,8 @@ export const MultisigSignerSchema = z.object({
65
65
  weight: z.number().positive().default(1),
66
66
  /** Whether this signer is "self" (controlled by this wallet instance) */
67
67
  isSelf: z.boolean().optional(),
68
+ /** Whether this row is a live on-chain key member that maps to no known account */
69
+ unresolved: z.boolean().optional(),
68
70
  });
69
71
  // ============================================================================
70
72
  // Unified Account Metadata Extensions
@@ -179,6 +181,9 @@ export function createMultisigMetadata(config, localSignerAddress) {
179
181
  *
180
182
  * @param existingMetadata - Current account metadata
181
183
  * @param multisigConfig - Multisig configuration to apply
184
+ * @param multisigConfig.threshold - Signatures (or summed weights) required to authorize
185
+ * @param multisigConfig.signers - Full member list, including any unresolved on-chain keys
186
+ * @param multisigConfig.name - Human-readable account label
182
187
  * @param localSignerAddress - Address of the local signer
183
188
  * @returns Updated metadata with multisig configuration
184
189
  */
@@ -1 +1 @@
1
- {"version":3,"file":"multisig-account.js","sourceRoot":"","sources":["../src/multisig-account.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC;AAEnE,+EAA+E;AAC/E,kBAAkB;AAClB,+EAA+E;AAE/E;;;;GAIG;AACH;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,2CAA2C;IAC3C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,2DAA2D;IAC3D,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,+DAA+D;IAC/D,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,yDAA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ACpC,MAA6B,EAC7B,kBAA2B;IAE3B,OAAO;QACL,WAAW,EAAE,UAAU;QACvB,QAAQ,EAAE;YACR,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,kBAAkB;YAClB,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,gBAAgB,EAAE,MAAM,CAAC,EAAE;SAC5B;QACD,KAAK,EAAE,MAAM,CAAC,IAAI;QAClB,SAAS,EAAE,MAAM,CAAC,SAAS;KAC5B,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,0BAA0B,CACxC,gBAAqD,EACrD,cAA+E,EAC/E,kBAA2B;IAE3B,MAAM,eAAe,GAAI,gBAAgB,EAAE,CAAC,SAAS,CAAY,IAAI,SAAS,CAAC;IAE/E,OAAO;QACL,GAAG,gBAAgB;QACnB,WAAW,EAAE,UAAU;QACvB,QAAQ,EAAE;YACR,SAAS,EAAE,cAAc,CAAC,SAAS;YACnC,OAAO,EAAE,cAAc,CAAC,OAAO;YAC/B,kBAAkB;YAClB,IAAI,EAAE,cAAc,CAAC,IAAI;YACzB,WAAW,EAAE,IAAI,CAAC,GAAG,EAAE;YACvB,wBAAwB,EAAE,eAAe;SAC1C;QACD,KAAK,EAAE,cAAc,CAAC,IAAI,IAAK,gBAAgB,EAAE,CAAC,OAAO,CAAY;KACtE,CAAC;AACJ,CAAC"}
package/dist/rpc.d.ts CHANGED
@@ -424,18 +424,21 @@ export declare const RpcSignRequestSchema: z.ZodObject<{
424
424
  account: z.ZodDefault<z.ZodNumber>;
425
425
  change: z.ZodDefault<z.ZodNumber>;
426
426
  addressIndex: z.ZodDefault<z.ZodNumber>;
427
+ bip39Passphrase: z.ZodOptional<z.ZodEnum<["network", "none"]>>;
427
428
  }, "strip", z.ZodTypeAny, {
428
429
  purpose?: number;
429
430
  coinType?: number;
430
431
  account?: number;
431
432
  change?: number;
432
433
  addressIndex?: number;
434
+ bip39Passphrase?: "network" | "none";
433
435
  }, {
434
436
  purpose?: number;
435
437
  coinType?: number;
436
438
  account?: number;
437
439
  change?: number;
438
440
  addressIndex?: number;
441
+ bip39Passphrase?: "network" | "none";
439
442
  }>>;
440
443
  context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
441
444
  keyType: z.ZodOptional<z.ZodEnum<["ed25519", "ecdsa"]>>;
@@ -465,6 +468,7 @@ export declare const RpcSignRequestSchema: z.ZodObject<{
465
468
  account?: number;
466
469
  change?: number;
467
470
  addressIndex?: number;
471
+ bip39Passphrase?: "network" | "none";
468
472
  };
469
473
  keyType?: "ed25519" | "ecdsa";
470
474
  payload?: string | Uint8Array<ArrayBuffer>;
@@ -488,6 +492,7 @@ export declare const RpcSignRequestSchema: z.ZodObject<{
488
492
  account?: number;
489
493
  change?: number;
490
494
  addressIndex?: number;
495
+ bip39Passphrase?: "network" | "none";
491
496
  };
492
497
  keyType?: "ed25519" | "ecdsa";
493
498
  payload?: string | Uint8Array<ArrayBuffer>;
@@ -513,6 +518,7 @@ export declare const RpcSignRequestSchema: z.ZodObject<{
513
518
  account?: number;
514
519
  change?: number;
515
520
  addressIndex?: number;
521
+ bip39Passphrase?: "network" | "none";
516
522
  };
517
523
  keyType?: "ed25519" | "ecdsa";
518
524
  payload?: string | Uint8Array<ArrayBuffer>;
@@ -543,6 +549,7 @@ export declare const RpcSignRequestSchema: z.ZodObject<{
543
549
  account?: number;
544
550
  change?: number;
545
551
  addressIndex?: number;
552
+ bip39Passphrase?: "network" | "none";
546
553
  };
547
554
  keyType?: "ed25519" | "ecdsa";
548
555
  payload?: string | Uint8Array<ArrayBuffer>;
package/dist/rpc.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"rpc.d.ts","sourceRoot":"","sources":["../src/rpc.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK5B,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * HSuite Native Connect
3
+ * Copyright 2024-2025 HSuite (https://hsuite.finance)
4
+ *
5
+ * SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
6
+ *
7
+ * This file is part of HSuite Native Connect. For commercial licensing,
8
+ * visit https://hsuite.finance/licensing
9
+ */
10
+ /**
11
+ * Pure helpers for deriving the user-facing headline amount from a raw
12
+ * ledger transaction.
13
+ *
14
+ * Extracted from `WalletStateService.enrichTransactionForUser` so we can
15
+ * unit-test the arithmetic without standing up the full DI graph (the
16
+ * wallet-app `pnpm test` runner is a no-op due to an Angular 20 / Karma
17
+ * bug — see project memory `project_wallet_vitest_infra.md`).
18
+ */
19
+ /** Mirror-node transaction slice the Hedera headline derivation reads. */
20
+ export interface HederaTransferMetadata {
21
+ transfers?: Array<{
22
+ account: string;
23
+ amount: number;
24
+ }>;
25
+ charged_tx_fee?: number;
26
+ }
27
+ /**
28
+ * Compute the gross HBAR transfer attributable to `userAddress` for a Hedera
29
+ * mirror-node transaction.
30
+ *
31
+ * Mirror node shape: each `transfers[]` entry is one signed delta. The user
32
+ * may appear:
33
+ * - As a SINGLE entry whose amount already includes their fee share
34
+ * subtracted (the common case — `{account: USER, amount: -100_500_000}`
35
+ * for "sent 1 ℏ + paid 0.005 ℏ fee").
36
+ * - As MULTIPLE entries (rare — e.g. one transfer + a separate fee row).
37
+ *
38
+ * In both cases `userTotal` reduces to the user's net delta. Sender status
39
+ * is derived from `userTotal < 0` (net outflow). Mirror nodes net the
40
+ * charged fee into the sender's row, so we add `charged_tx_fee` back to
41
+ * recover the gross transfer; receivers (net inflow) never had a fee netted
42
+ * in, so no add-back. Deriving sender from the data — rather than from
43
+ * `tx.from === userAddress` passed by the caller — avoids a scheduled-tx
44
+ * footgun where `tx.from` is not the actual fee payer.
45
+ *
46
+ * Returns `undefined` when the user does not appear in `transfers` at all
47
+ * (e.g. an `ACCOUNTUPDATE` or other non-payment transaction). The caller
48
+ * should render that as "—" rather than "0 ℏ".
49
+ *
50
+ * @param metadata transaction metadata as captured from the mirror node
51
+ * @param userAddress the wallet account being enriched (e.g. `0.0.12345`)
52
+ * @returns gross transfer in tinybars, or `undefined` if no user entry
53
+ */
54
+ export declare function extractUserAmountForHedera(metadata: HederaTransferMetadata | undefined, userAddress: string): number | undefined;
55
+ /** XRPL adapter transaction slice the XRP headline derivation reads. */
56
+ export interface XrplAmountTx {
57
+ amount?: number | string | null;
58
+ from?: string;
59
+ to?: string;
60
+ }
61
+ /**
62
+ * Compute the signed XRP drops headline for an XRPL transaction from the
63
+ * user's perspective.
64
+ *
65
+ * XRPL `tx.amount` is only populated for `Payment` and a few other transfer
66
+ * types. Non-payment transactions (`TrustSet`, `AccountSet`, `OfferCreate`,
67
+ * …) leave it absent — in that case there is no amount to display, and the
68
+ * caller should render the row without one. We return `undefined` instead
69
+ * of `0` so the UI can distinguish "zero transfer" from "no transfer".
70
+ *
71
+ * Returns `undefined` for non-finite amounts (e.g. XRPL IOU object shape
72
+ * `{currency, value, issuer}` or malformed strings), so callers don't have
73
+ * to pre-filter. Issued-currency payments are not XRP transfers and have no
74
+ * drops-denominated headline to display.
75
+ *
76
+ * Sign convention:
77
+ * - `tx.from === userAddress` → negative (outgoing)
78
+ * - `tx.to === userAddress` → positive (incoming)
79
+ * - neither matches → positive raw value (defensive — e.g. offer
80
+ * fulfillments where the user is not a direct participant on the
81
+ * payment leg).
82
+ *
83
+ * @param tx transaction fragment from the XRPL adapter
84
+ * @param userAddress the wallet account being enriched (r-address)
85
+ * @returns signed drops, or `undefined` if the tx has no amount
86
+ */
87
+ export declare function extractUserAmountForXrpl(tx: XrplAmountTx | undefined, userAddress: string): number | undefined;
88
+ //# sourceMappingURL=transaction-amount-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction-amount-utils.d.ts","sourceRoot":"","sources":["../src/transaction-amount-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;GAQG;AAEH,0EAA0E;AAC1E,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,sBAAsB,GAAG,SAAS,EAC5C,WAAW,EAAE,MAAM,GAClB,MAAM,GAAG,SAAS,CAYpB;AAED,wEAAwE;AACxE,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,wBAAwB,CACtC,EAAE,EAAE,YAAY,GAAG,SAAS,EAC5B,WAAW,EAAE,MAAM,GAClB,MAAM,GAAG,SAAS,CAiBpB"}
@@ -0,0 +1,94 @@
1
+ /**
2
+ * HSuite Native Connect
3
+ * Copyright 2024-2025 HSuite (https://hsuite.finance)
4
+ *
5
+ * SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
6
+ *
7
+ * This file is part of HSuite Native Connect. For commercial licensing,
8
+ * visit https://hsuite.finance/licensing
9
+ */
10
+ /**
11
+ * Compute the gross HBAR transfer attributable to `userAddress` for a Hedera
12
+ * mirror-node transaction.
13
+ *
14
+ * Mirror node shape: each `transfers[]` entry is one signed delta. The user
15
+ * may appear:
16
+ * - As a SINGLE entry whose amount already includes their fee share
17
+ * subtracted (the common case — `{account: USER, amount: -100_500_000}`
18
+ * for "sent 1 ℏ + paid 0.005 ℏ fee").
19
+ * - As MULTIPLE entries (rare — e.g. one transfer + a separate fee row).
20
+ *
21
+ * In both cases `userTotal` reduces to the user's net delta. Sender status
22
+ * is derived from `userTotal < 0` (net outflow). Mirror nodes net the
23
+ * charged fee into the sender's row, so we add `charged_tx_fee` back to
24
+ * recover the gross transfer; receivers (net inflow) never had a fee netted
25
+ * in, so no add-back. Deriving sender from the data — rather than from
26
+ * `tx.from === userAddress` passed by the caller — avoids a scheduled-tx
27
+ * footgun where `tx.from` is not the actual fee payer.
28
+ *
29
+ * Returns `undefined` when the user does not appear in `transfers` at all
30
+ * (e.g. an `ACCOUNTUPDATE` or other non-payment transaction). The caller
31
+ * should render that as "—" rather than "0 ℏ".
32
+ *
33
+ * @param metadata transaction metadata as captured from the mirror node
34
+ * @param userAddress the wallet account being enriched (e.g. `0.0.12345`)
35
+ * @returns gross transfer in tinybars, or `undefined` if no user entry
36
+ */
37
+ export function extractUserAmountForHedera(metadata, userAddress) {
38
+ const entries = (metadata?.transfers ?? []).filter((t) => t.account === userAddress);
39
+ if (entries.length === 0) {
40
+ return undefined;
41
+ }
42
+ const userTotal = entries.reduce((sum, t) => sum + t.amount, 0);
43
+ // Sender = net outflow. Mirror nets the fee into the sender's row, so we
44
+ // add it back to recover the gross transfer. Receivers (net inflow) never
45
+ // had a fee netted in, so no add-back.
46
+ const userIsSender = userTotal < 0;
47
+ const userPaidFee = userIsSender ? Number(metadata?.charged_tx_fee) || 0 : 0;
48
+ return userTotal + userPaidFee;
49
+ }
50
+ /**
51
+ * Compute the signed XRP drops headline for an XRPL transaction from the
52
+ * user's perspective.
53
+ *
54
+ * XRPL `tx.amount` is only populated for `Payment` and a few other transfer
55
+ * types. Non-payment transactions (`TrustSet`, `AccountSet`, `OfferCreate`,
56
+ * …) leave it absent — in that case there is no amount to display, and the
57
+ * caller should render the row without one. We return `undefined` instead
58
+ * of `0` so the UI can distinguish "zero transfer" from "no transfer".
59
+ *
60
+ * Returns `undefined` for non-finite amounts (e.g. XRPL IOU object shape
61
+ * `{currency, value, issuer}` or malformed strings), so callers don't have
62
+ * to pre-filter. Issued-currency payments are not XRP transfers and have no
63
+ * drops-denominated headline to display.
64
+ *
65
+ * Sign convention:
66
+ * - `tx.from === userAddress` → negative (outgoing)
67
+ * - `tx.to === userAddress` → positive (incoming)
68
+ * - neither matches → positive raw value (defensive — e.g. offer
69
+ * fulfillments where the user is not a direct participant on the
70
+ * payment leg).
71
+ *
72
+ * @param tx transaction fragment from the XRPL adapter
73
+ * @param userAddress the wallet account being enriched (r-address)
74
+ * @returns signed drops, or `undefined` if the tx has no amount
75
+ */
76
+ export function extractUserAmountForXrpl(tx, userAddress) {
77
+ if (!tx || tx.amount === undefined || tx.amount === null) {
78
+ return undefined;
79
+ }
80
+ const rawAmount = Number(tx.amount);
81
+ if (!Number.isFinite(rawAmount)) {
82
+ // IOU object, malformed string, or other unrepresentable input.
83
+ return undefined;
84
+ }
85
+ if (tx.from === userAddress) {
86
+ return -rawAmount;
87
+ }
88
+ if (tx.to === userAddress) {
89
+ return rawAmount;
90
+ }
91
+ // Not a direct participant — surface the raw value without a sign hint.
92
+ return rawAmount;
93
+ }
94
+ //# sourceMappingURL=transaction-amount-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction-amount-utils.js","sourceRoot":"","sources":["../src/transaction-amount-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAkBH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,0BAA0B,CACxC,QAA4C,EAC5C,WAAmB;IAEnB,MAAM,OAAO,GAAG,CAAC,QAAQ,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,WAAW,CAAC,CAAC;IACrF,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAChE,yEAAyE;IACzE,0EAA0E;IAC1E,uCAAuC;IACvC,MAAM,YAAY,GAAG,SAAS,GAAG,CAAC,CAAC;IACnC,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,OAAO,SAAS,GAAG,WAAW,CAAC;AACjC,CAAC;AASD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,wBAAwB,CACtC,EAA4B,EAC5B,WAAmB;IAEnB,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,MAAM,KAAK,SAAS,IAAI,EAAE,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;QACzD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,SAAS,GAAG,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;IACpC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QAChC,gEAAgE;QAChE,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,EAAE,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QAC5B,OAAO,CAAC,SAAS,CAAC;IACpB,CAAC;IACD,IAAI,EAAE,CAAC,EAAE,KAAK,WAAW,EAAE,CAAC;QAC1B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,wEAAwE;IACxE,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -63,7 +63,7 @@ export interface ParsedTransactionField {
63
63
  * (3). The second segment is the SDK class family; the third is the
64
64
  * variant when it matters.
65
65
  */
66
- export type TxKind = 'hedera.transfer.hbar' | 'hedera.transfer.token' | 'hedera.transfer.nft' | 'hedera.token.associate' | 'hedera.token.dissociate' | 'hedera.token.create' | 'hedera.token.mint' | 'hedera.token.burn' | 'hedera.token.update' | 'hedera.token.delete' | 'hedera.token.wipe' | 'hedera.token.freeze' | 'hedera.token.unfreeze' | 'hedera.token.pause' | 'hedera.token.unpause' | 'hedera.token.grantkyc' | 'hedera.token.revokekyc' | 'hedera.topic.create' | 'hedera.topic.update' | 'hedera.topic.delete' | 'hedera.topic.submit' | 'hedera.account.create' | 'hedera.account.update' | 'hedera.account.delete' | 'hedera.contract.call' | 'hedera.contract.create' | 'hedera.schedule.create' | 'hedera.schedule.sign' | 'hedera.schedule.delete' | 'hedera.batch' | 'hedera.message.sign' | 'hedera.file.create' | 'hedera.file.update' | 'hedera.file.delete' | 'hedera.file.append' | 'hedera.parse-error';
66
+ export type TxKind = 'hedera.transfer.hbar' | 'hedera.transfer.token' | 'hedera.transfer.nft' | 'hedera.token.associate' | 'hedera.token.dissociate' | 'hedera.token.create' | 'hedera.token.mint' | 'hedera.token.burn' | 'hedera.token.update' | 'hedera.token.delete' | 'hedera.token.wipe' | 'hedera.token.freeze' | 'hedera.token.unfreeze' | 'hedera.token.pause' | 'hedera.token.unpause' | 'hedera.token.grantkyc' | 'hedera.token.revokekyc' | 'hedera.topic.create' | 'hedera.topic.update' | 'hedera.topic.delete' | 'hedera.topic.submit' | 'hedera.account.create' | 'hedera.account.update' | 'hedera.account.delete' | 'hedera.contract.call' | 'hedera.contract.create' | 'hedera.schedule.create' | 'hedera.schedule.sign' | 'hedera.schedule.delete' | 'hedera.allowance.approve' | 'hedera.batch' | 'hedera.message.sign' | 'hedera.file.create' | 'hedera.file.update' | 'hedera.file.delete' | 'hedera.file.append' | 'hedera.parse-error';
67
67
  /**
68
68
  * @description Base transaction data for approval.
69
69
  *
@@ -300,6 +300,12 @@ export interface HederaTransactionData extends BaseTransactionData {
300
300
  * aggregation (e.g., non-Hedera batches).
301
301
  */
302
302
  batchNetImpact?: BatchNetImpact;
303
+ /**
304
+ * Spending approvals decoded from an `AccountAllowanceApproveTransaction`,
305
+ * one entry per approval in its `hbarApprovals`, `tokenApprovals` and
306
+ * `tokenNftApprovals` lists. Only present on that transaction type.
307
+ */
308
+ allowances?: HederaAllowanceApproval[];
303
309
  /**
304
310
  * Structured diff for `AccountUpdate` transactions — only present when
305
311
  * `type === 'AccountUpdate'`.
@@ -421,6 +427,43 @@ export interface ScheduleCreateEnvelope {
421
427
  * modal can render a "could not verify schedule state" affordance
422
428
  * instead of silently showing stale data.
423
429
  */
430
+ /**
431
+ * The one summary for any transaction shown to the user: a multisig proposal,
432
+ * a dApp request, a widget batch, a send review or a history record. It is
433
+ * built once and read by the hub/sheet cards, the drawer header and the
434
+ * approval review, so the title, the figure and the rows can never disagree.
435
+ * Amounts arrive formatted by the canonical formatter with a "." decimal mark.
436
+ */
437
+ export interface TransactionSummaryCard {
438
+ /** Mapper that produced the card, e.g. 'hbar-transfer', 'token-transfer', 'xrp-payment', 'generic'. */
439
+ kind: string;
440
+ /** Translated verb ("Send"). */
441
+ verb: string;
442
+ /** What the verb applies to ("25 ℏ", "12.5 DCT · 3 recipients", "DCT"). */
443
+ object: string;
444
+ /** `verb + ' ' + object`, the card title. */
445
+ title: string;
446
+ /** Primary figure when there is one ("25 ℏ"); absent for associations, policies, schedules. */
447
+ figure?: string;
448
+ /** Single destination when there is exactly one. */
449
+ to?: string;
450
+ /** Network fee, formatted. */
451
+ fee?: string;
452
+ /** Up to five key-value rows for the type. */
453
+ rows: Array<{
454
+ label: string;
455
+ value: string;
456
+ }>;
457
+ /** One line per recipient / token / NFT when the transfer has several legs. */
458
+ legs?: Array<{
459
+ to: string;
460
+ amount: string;
461
+ symbol?: string;
462
+ }>;
463
+ }
464
+ /**
465
+ *
466
+ */
424
467
  export interface ScheduleSignPayload {
425
468
  /** On-chain schedule ID being signed (e.g., `"0.0.226412"`). */
426
469
  scheduleId: string;
@@ -543,6 +586,48 @@ export interface TxShapeDetection {
543
586
  /** Which parser produced this verdict. Undefined on negatives. */
544
587
  parsedKind?: 'hedera.transaction' | 'xrpl.transaction';
545
588
  }
589
+ /**
590
+ * One spending approval granted by an `AccountAllowanceApproveTransaction`.
591
+ *
592
+ * Every field except the token `decimals` / `symbol` / `name` comes from the
593
+ * transaction bytes. Those three are mirror-node metadata, filled in by the
594
+ * wallet's approval enrichment when available and absent otherwise, so the
595
+ * UI must not scale a token `amount` without `decimals`.
596
+ */
597
+ export type HederaAllowanceApproval = {
598
+ kind: 'hbar';
599
+ /** Account the allowance draws from, when the approval names one. */
600
+ ownerAccountId?: string;
601
+ spenderAccountId: string;
602
+ /** Allowance cap in tinybars, as a decimal string. */
603
+ amount: string;
604
+ /** The cap is the maximal value, i.e. no effective limit. */
605
+ unlimited: boolean;
606
+ } | {
607
+ kind: 'token';
608
+ ownerAccountId?: string;
609
+ spenderAccountId: string;
610
+ tokenId: string;
611
+ /** Allowance cap in the token's raw base units, as a decimal string. */
612
+ amount: string;
613
+ unlimited: boolean;
614
+ decimals?: number;
615
+ symbol?: string;
616
+ name?: string;
617
+ } | {
618
+ kind: 'nft';
619
+ ownerAccountId?: string;
620
+ spenderAccountId: string;
621
+ tokenId: string;
622
+ /** Specific serials approved. Empty when `allSerials` is true. */
623
+ serials: number[];
624
+ /** Approval covers every serial of the collection, including future ones. */
625
+ allSerials: boolean;
626
+ /** Spender already approved for all serials who is delegating this approval. */
627
+ delegatingSpenderAccountId?: string;
628
+ symbol?: string;
629
+ name?: string;
630
+ };
546
631
  /**
547
632
  * @description Aggregated net impact across all inner transactions in
548
633
  * a `BatchTransaction`. Computed from the signer's perspective —
@@ -952,8 +1037,26 @@ export interface TransactionApprovalContext {
952
1037
  need: number;
953
1038
  members: string[];
954
1039
  };
1040
+ /** Signer identities and collected signatures for the approval review. */
1041
+ signers?: Array<{
1042
+ address: string;
1043
+ label?: string;
1044
+ signed: boolean;
1045
+ isSelf: boolean;
1046
+ required: boolean;
1047
+ /** This signer proposed the transaction. */
1048
+ proposer?: boolean;
1049
+ }>;
1050
+ /** Absolute proposal expiry, in milliseconds since the Unix epoch. */
1051
+ expiresAt?: number;
955
1052
  /** Who initiated this proposal */
956
1053
  initiator: string;
1054
+ /** Display label of the initiator (a signer label), when known. */
1055
+ initiatorLabel?: string;
1056
+ /** Proposal summary shown as the review title ("Send 25 ℏ"). */
1057
+ title?: string;
1058
+ /** The one summary contract every surface reads (hub card, header, hero, rows). */
1059
+ summary?: TransactionSummaryCard;
957
1060
  };
958
1061
  /** Inner transactions for batch transactions */
959
1062
  innerTransactions?: Array<{