@fairmint/canton-node-sdk 0.0.282 → 0.0.284

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 (72) hide show
  1. package/README.md +129 -155
  2. package/build/src/utils/external-signing/wallet-ownership-challenger.d.ts.map +1 -1
  3. package/build/src/utils/external-signing/wallet-ownership-challenger.js +2 -3
  4. package/build/src/utils/external-signing/wallet-ownership-challenger.js.map +1 -1
  5. package/build/src/utils/external-signing/wallet-ownership.d.ts.map +1 -1
  6. package/build/src/utils/external-signing/wallet-ownership.js +8 -18
  7. package/build/src/utils/external-signing/wallet-ownership.js.map +1 -1
  8. package/build/src/wallets/acs.d.ts +2 -1
  9. package/build/src/wallets/acs.d.ts.map +1 -1
  10. package/build/src/wallets/acs.js +6 -31
  11. package/build/src/wallets/acs.js.map +1 -1
  12. package/build/src/wallets/cip103.d.ts +32 -68
  13. package/build/src/wallets/cip103.d.ts.map +1 -1
  14. package/build/src/wallets/cip103.js +112 -230
  15. package/build/src/wallets/cip103.js.map +1 -1
  16. package/build/src/wallets/commands.d.ts +39 -6
  17. package/build/src/wallets/commands.d.ts.map +1 -1
  18. package/build/src/wallets/commands.js +50 -5
  19. package/build/src/wallets/commands.js.map +1 -1
  20. package/build/src/wallets/contracts.d.ts +12 -0
  21. package/build/src/wallets/contracts.d.ts.map +1 -1
  22. package/build/src/wallets/contracts.js +21 -5
  23. package/build/src/wallets/contracts.js.map +1 -1
  24. package/build/src/wallets/da-utilities/client.d.ts +61 -29
  25. package/build/src/wallets/da-utilities/client.d.ts.map +1 -1
  26. package/build/src/wallets/da-utilities/client.js +78 -75
  27. package/build/src/wallets/da-utilities/client.js.map +1 -1
  28. package/build/src/wallets/errors.d.ts +11 -8
  29. package/build/src/wallets/errors.d.ts.map +1 -1
  30. package/build/src/wallets/errors.js +13 -3
  31. package/build/src/wallets/errors.js.map +1 -1
  32. package/build/src/wallets/holdings.d.ts +14 -4
  33. package/build/src/wallets/holdings.d.ts.map +1 -1
  34. package/build/src/wallets/holdings.js +27 -47
  35. package/build/src/wallets/holdings.js.map +1 -1
  36. package/build/src/wallets/index.d.ts +17 -21
  37. package/build/src/wallets/index.d.ts.map +1 -1
  38. package/build/src/wallets/index.js +14 -23
  39. package/build/src/wallets/index.js.map +1 -1
  40. package/build/src/wallets/instrument.js +1 -1
  41. package/build/src/wallets/instrument.js.map +1 -1
  42. package/build/src/wallets/ownership.d.ts +20 -26
  43. package/build/src/wallets/ownership.d.ts.map +1 -1
  44. package/build/src/wallets/ownership.js +33 -27
  45. package/build/src/wallets/ownership.js.map +1 -1
  46. package/build/src/wallets/session.d.ts +30 -68
  47. package/build/src/wallets/session.d.ts.map +1 -1
  48. package/build/src/wallets/session.js +119 -167
  49. package/build/src/wallets/session.js.map +1 -1
  50. package/build/src/wallets/store.d.ts +148 -86
  51. package/build/src/wallets/store.d.ts.map +1 -1
  52. package/build/src/wallets/store.js +267 -99
  53. package/build/src/wallets/store.js.map +1 -1
  54. package/build/src/wallets/templates.d.ts +10 -23
  55. package/build/src/wallets/templates.d.ts.map +1 -1
  56. package/build/src/wallets/templates.js +9 -33
  57. package/build/src/wallets/templates.js.map +1 -1
  58. package/build/src/wallets/types.d.ts +6 -20
  59. package/build/src/wallets/types.d.ts.map +1 -1
  60. package/build/src/wallets/wallet.d.ts +130 -74
  61. package/build/src/wallets/wallet.d.ts.map +1 -1
  62. package/build/src/wallets/wallet.js +347 -185
  63. package/build/src/wallets/wallet.js.map +1 -1
  64. package/package.json +2 -2
  65. package/build/src/wallets/cip56-core.d.ts +0 -175
  66. package/build/src/wallets/cip56-core.d.ts.map +0 -1
  67. package/build/src/wallets/cip56-core.js +0 -325
  68. package/build/src/wallets/cip56-core.js.map +0 -1
  69. package/build/src/wallets/token-registry.d.ts +0 -97
  70. package/build/src/wallets/token-registry.d.ts.map +0 -1
  71. package/build/src/wallets/token-registry.js +0 -19
  72. package/build/src/wallets/token-registry.js.map +0 -1
@@ -1,97 +0,0 @@
1
- /**
2
- * The CIP-56 (token standard V1) registry seam: what a transfer, or an answer to a pending transfer, needs from the
3
- * instrument's registry off ledger. DA's Utility Registry implements it today (`createDaUtilitiesClient`); another
4
- * registry (for example Canton Coin) is a new implementation of this interface.
5
- */
6
- import type { TransferOffer } from './contracts';
7
- import type { JsonObject } from './json';
8
- import type { ActiveContract, ContractFilter, DisclosedContract, InstrumentId } from './types';
9
- /** Splice `ChoiceContext` data: passed through unchanged as `extraArgs.context`. */
10
- export interface ChoiceContextData {
11
- readonly values: JsonObject;
12
- }
13
- /** What the registry returns for a choice: its context, and the contracts to disclose with the submission. */
14
- export interface ChoiceContext {
15
- readonly choiceContextData: ChoiceContextData;
16
- readonly disclosedContracts: readonly DisclosedContract[];
17
- }
18
- /** A factory to exercise, with its choice context. */
19
- export interface FactoryWithChoiceContext extends ChoiceContext {
20
- readonly factoryId: string;
21
- }
22
- /**
23
- * How the registry will run a transfer:
24
- *
25
- * - `offer`: a pending transfer the receiver must accept before it expires. The sender's tokens stay locked until the
26
- * offer is accepted, rejected by the receiver or withdrawn by the sender; expiry alone only stops acceptance and does
27
- * not unlock them (withdraw an expired offer to get them back);
28
- * - `direct`: the receiver pre-approved transfers, so the holdings move at once;
29
- * - `self`: sender and receiver are the same party (the holdings are merged or split).
30
- */
31
- export type TransferKind = 'offer' | 'direct' | 'self';
32
- export interface TransferFactory extends FactoryWithChoiceContext {
33
- readonly transferKind: TransferKind;
34
- }
35
- /** The CIP-56 `Transfer` record. */
36
- export interface TransferSpec {
37
- readonly sender: string;
38
- readonly receiver: string;
39
- /** Decimal string. */
40
- readonly amount: string;
41
- readonly instrumentId: InstrumentId;
42
- /** ISO-8601. */
43
- readonly requestedAt: string;
44
- /** ISO-8601. */
45
- readonly executeBefore: string;
46
- readonly inputHoldingCids: readonly string[];
47
- readonly meta: {
48
- readonly values: Readonly<Record<string, string>>;
49
- };
50
- }
51
- export interface TransferFactoryArgs {
52
- readonly expectedAdmin: string;
53
- readonly transfer: TransferSpec;
54
- }
55
- /** An action on a pending transfer: the receiver accepts or rejects, the sender withdraws. */
56
- export type TransferInstructionAction = 'accept' | 'reject' | 'withdraw';
57
- /** Reads the wallet party's active contracts matching a filter (the wallet's own ACS). */
58
- export type ReadContracts = (filter: ContractFilter) => Promise<ActiveContract[]>;
59
- export interface TokenRegistry {
60
- /**
61
- * Whether a holding read through the CIP-56 HoldingV1 interface is one of this registry's, and genuine: of its
62
- * template and signed by the party that issues it (any party can create a look-alike with the wallet party as
63
- * observer). A wallet also holds other registries' holdings (Canton Coin, other registries' tokens); the token wallet
64
- * lists and spends only the ones this returns true for.
65
- */
66
- servesHolding(contract: ActiveContract): boolean;
67
- /**
68
- * Filters a token wallet reads holdings with besides the CIP-56 HoldingV1 interface, for example the registry's own
69
- * holding template, whose create argument still reads when the ledger could not compute a HoldingV1 view. Every read
70
- * of holdings (a write's fresh read and the state snapshot) uses the same filters, and the same `servesHolding`.
71
- */
72
- readonly holdingFilters?: readonly ContractFilter[];
73
- /**
74
- * This registry's pending transfers (CIP-56 TransferInstructions) visible to the wallet, read through `read` and
75
- * checked to be genuine (made by the registry, not a look-alike any party could create). Both directions: the caller
76
- * splits them by sender and receiver.
77
- */
78
- pendingTransfers(read: ReadContracts): Promise<TransferOffer[]>;
79
- /**
80
- * The filters `pendingTransfers` reads. A token wallet adds them to its one state snapshot, so listing pending
81
- * transfers costs no ledger read of its own; a read of any other filter goes to the wallet separately.
82
- */
83
- readonly pendingTransferFilters?: readonly ContractFilter[];
84
- /**
85
- * `Module:Entity` names of the templates this registry's transfer factory may have. A factory of any other template
86
- * is refused before anything is signed.
87
- */
88
- readonly expectedTransferFactoryTemplates: readonly string[];
89
- transferFactory(args: TransferFactoryArgs): Promise<TransferFactory>;
90
- transferInstructionContext(registrar: string, instructionCid: string, action: TransferInstructionAction): Promise<ChoiceContext>;
91
- }
92
- /**
93
- * Null when `factoryId` is one of the disclosed contracts and its template is expected; otherwise why not. A registry
94
- * that names any other contract is refused before anything is signed.
95
- */
96
- export declare function factoryTemplateError(factory: FactoryWithChoiceContext, expectedTemplates: readonly string[]): string | null;
97
- //# sourceMappingURL=token-registry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"token-registry.d.ts","sourceRoot":"","sources":["../../../src/wallets/token-registry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEzC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE/F,oFAAoF;AACpF,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;CAC7B;AAED,8GAA8G;AAC9G,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAC9C,QAAQ,CAAC,kBAAkB,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAC3D;AAED,sDAAsD;AACtD,MAAM,WAAW,wBAAyB,SAAQ,aAAa;IAC7D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEvD,MAAM,WAAW,eAAgB,SAAQ,wBAAwB;IAC/D,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;CACrC;AAED,oCAAoC;AACpC,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,sBAAsB;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,gBAAgB;IAChB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;I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AAoB,CAClC,OAAO,EAAE,wBAAwB,EACjC,iBAAiB,EAAE,SAAS,MAAM,EAAE,GACnC,MAAM,GAAG,IAAI,CASf"}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.factoryTemplateError = factoryTemplateError;
4
- const templates_1 = require("./templates");
5
- /**
6
- * Null when `factoryId` is one of the disclosed contracts and its template is expected; otherwise why not. A registry
7
- * that names any other contract is refused before anything is signed.
8
- */
9
- function factoryTemplateError(factory, expectedTemplates) {
10
- const disclosed = factory.disclosedContracts.find((contract) => contract.contractId === factory.factoryId);
11
- if (!disclosed) {
12
- return 'The registry named a factory it did not disclose.';
13
- }
14
- const name = (0, templates_1.qualifiedName)(disclosed.templateId);
15
- return name !== null && expectedTemplates.includes(name)
16
- ? null
17
- : `The registry named a factory of an unexpected template (${disclosed.templateId}).`;
18
- }
19
- //# sourceMappingURL=token-registry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"token-registry.js","sourceRoot":"","sources":["../../../src/wallets/token-registry.ts"],"names":[],"mappings":";;;AAOA,2CAA4C;AAkG5C;;;GAGG;AACH,8BACE,OAAiC,EACjC,iBAAoC;IAEpC,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,UAAU,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;IAC3G,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,mDAAmD,CAAC;IAC7D,CAAC;IACD,MAAM,IAAI,GAAG,IAAA,yBAAa,EAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACjD,OAAO,IAAI,KAAK,IAAI,IAAI,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC;QACtD,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,2DAA2D,SAAS,CAAC,UAAU,IAAI,CAAC;AAC1F,CAAC"}