@ledgerhq/coin-module-framework 11.4.0 → 13.1.0

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.
@@ -60,9 +60,10 @@ export type Operation<MemoType extends Memo = MemoNotSupported> = {
60
60
  /**
61
61
  * The transaction this operation belongs to.
62
62
  *
63
- * When the caller sets {@link ListOperationsOptions.feesAsset}, these rules apply:
63
+ * Fee rules:
64
64
  *
65
- * 1. When {@link tx.feesAsset} is absent, the fee is in the native coin.
65
+ * 1. Modules set {@link tx.feesAsset}, also when the fee is in the native coin. While it is optional, an absent
66
+ * {@link tx.feesAsset} means the native coin.
66
67
  * 2. A consumer debits {@link tx.fees} once, in {@link tx.feesAsset}, from {@link tx.feesPayer}. A failed transaction
67
68
  * also pays.
68
69
  * 3. Operations never include the fee movement, in any asset. When a chain emits the fee as token transfers, the
@@ -77,9 +78,10 @@ export type Operation<MemoType extends Memo = MemoNotSupported> = {
77
78
  /** The network fees paid, in base units of {@link feesAsset}, or of the native coin when it is absent. */
78
79
  fees: bigint;
79
80
  /**
80
- * The asset that paid {@link fees}. Absent means the native coin.
81
+ * The asset that paid {@link fees}.
81
82
  *
82
- * Set only when the caller sets {@link ListOperationsOptions.feesAsset}.
83
+ * Modules must set it, also when the fee is in the native coin. It is optional until every module sets it, and
84
+ * will then become required. Until then, absent means the native coin.
83
85
  */
84
86
  feesAsset?: AssetInfo;
85
87
  feesPayer?: string;
@@ -117,9 +119,10 @@ export type Block = {
117
119
  /**
118
120
  * A transaction belonging to a {@link Block}, not specific to a particular account/address.
119
121
  *
120
- * When the caller sets {@link GetBlockOptions.feesAsset}, these rules apply:
122
+ * Fee rules:
121
123
  *
122
- * 1. When {@link feesAsset} is absent, the fee is in the native coin.
124
+ * 1. Modules set {@link feesAsset}, also when the fee is in the native coin. While it is optional, an absent
125
+ * {@link feesAsset} means the native coin.
123
126
  * 2. A consumer debits {@link fees} once, in {@link feesAsset}, from {@link feesPayer}. A failed transaction also
124
127
  * pays.
125
128
  * 3. {@link operations} never include the fee movement, in any asset. When a chain emits the fee as token transfers,
@@ -155,9 +158,10 @@ export type BlockTransaction = {
155
158
  */
156
159
  fees: bigint;
157
160
  /**
158
- * The asset that paid {@link fees}. Absent means the native coin.
161
+ * The asset that paid {@link fees}.
159
162
  *
160
- * Set only when the caller sets {@link GetBlockOptions.feesAsset}.
163
+ * Modules must set it, also when the fee is in the native coin. It is optional until every module sets it, and
164
+ * will then become required. Until then, absent means the native coin.
161
165
  */
162
166
  feesAsset?: AssetInfo;
163
167
  /** The address that paid for this transaction's fees. */
@@ -203,6 +207,21 @@ export type Balance = {
203
207
  locked?: bigint;
204
208
  /** The {@link Stake} this balance is part of, if any. */
205
209
  stake?: Stake;
210
+ /**
211
+ * A module-defined partition of one asset inside one account, for a chain that holds the same
212
+ * asset in several pools with different spend rules (a privacy chain's public and shielded pools).
213
+ * Opaque to the framework: an identity, never interpreted.
214
+ *
215
+ * Consumers aggregate the entries of one asset (`Σ value`, `Σ (value − locked)`) and never pick
216
+ * one. A pool that cannot fund a transaction reports `locked === value`. A pool is not an asset and
217
+ * never produces a sub-account. Pool and privacy metadata do not replace stake partition identity
218
+ * and are not, together with the asset, a unique key for balance entries.
219
+ *
220
+ * Absent: no pool distinction is specified; separate stake partitions may still exist.
221
+ */
222
+ pool?: string;
223
+ /** The entry is held privately and is not visible on-chain. Absent: public. */
224
+ private?: boolean;
206
225
  };
207
226
  /** The actions that are possible to do from a {@link Stake}. */
208
227
  export type StakeAction = 'delegate' | 'redelegate' | 'undelegate' | 'claim_reward' | 'withdraw';
@@ -332,6 +351,8 @@ export type TransactionIntent<MemoType extends Memo = MemoNotSupported, TxDataTy
332
351
  recipient: string;
333
352
  amount: bigint;
334
353
  asset: AssetInfo;
354
+ /** The {@link Balance.pool} that funds this transaction. Absent: the module chooses. */
355
+ pool?: string;
335
356
  useAllAmount?: boolean;
336
357
  senderPublicKey?: string;
337
358
  sequence?: bigint;
@@ -478,24 +499,6 @@ export type ListOperationsOptions = {
478
499
  * Implementation must raise a "not supported" error if order is set and not supported.
479
500
  */
480
501
  order?: 'asc' | 'desc';
481
- /**
482
- * Report the asset that paid each fee, as `feesAsset` in {@link Operation.tx}, under the rules stated there.
483
- *
484
- * When it is not set, the output is the legacy one: `fees` is read as native. A module that honours this option
485
- * declares it in `CoinModuleImpl.readOptions`; otherwise `withDefaults` rejects the call.
486
- */
487
- feesAsset?: boolean;
488
- };
489
- /** Options for {@link CoinModuleApi#getBlock}. */
490
- export type GetBlockOptions = {
491
- /**
492
- * Report the asset that paid each fee in {@link BlockTransaction.feesAsset}, under the rules on
493
- * {@link BlockTransaction}.
494
- *
495
- * When it is not set, the output is the legacy one: `fees` is read as native. A module that honours this option
496
- * declares it in `CoinModuleImpl.readOptions`; otherwise `withDefaults` rejects the call.
497
- */
498
- feesAsset?: boolean;
499
502
  };
500
503
  /** A network validator */
501
504
  export type Validator = {
@@ -636,11 +639,10 @@ export type CoinModuleApi<ConfigType extends CurrencyConfig, MemoType extends Me
636
639
  *
637
640
  * @param context the {@link Context} carrying the coin config accessor and logger
638
641
  * @param height the block height to query
639
- * @param options see {@link GetBlockOptions}
640
642
  * @returns the complete block with transactions
641
643
  * @throws "not supported" if the blockchain does not support querying full blocks
642
644
  */
643
- getBlock: (context: Context<ConfigType>, height: number, options?: GetBlockOptions) => Promise<Block>;
645
+ getBlock: (context: Context<ConfigType>, height: number) => Promise<Block>;
644
646
  /**
645
647
  * Perform a direct, read-only smart-contract call against the underlying node or indexer.
646
648
  *
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAGxD,MAAM,MAAM,eAAe,GAAG;IAC5B,YAAY,EAAE,OAAO,CAAA;IACrB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,MAAM,CAAC,EAAE,iBAAiB,C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AAE,aAAa,CAAA;KAAE,KACrC,OAAO,CAAC,qBAAqB,CAAC,CAAA;IAEnC;;;;;;OAMG;IACH,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAEnF;;;;;;;OAOG;IACH,eAAe,EAAE,CACf,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,EAC5B,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,OAAO,CAAC,mCAAmC,CAAC,KACrD,OAAO,CAAC,OAAO,CAAC,CAAA;IAErB;;;;;;;OAOG;IACH,oBAAoB,EAAE,CACpB,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,EAC5B,MAAM,EAAE,iBAAiB,CAAC,QAAQ,EAAE,UAAU,CAAC,KAC5C,UAAU,CAAA;CAChB,CAAA"}
@@ -1,9 +1,8 @@
1
1
  import type { CurrencyConfig } from '../config';
2
- import type { CoinModuleImpl, OptionalApiKey, ReadOption, ReadOptionMethod } from './impl';
2
+ import type { CoinModuleImpl, OptionalApiKey } from './impl';
3
3
  import type { CoinModuleApi, Memo, MemoNotSupported, TxData, TxDataNotSupported } from './types';
4
4
  /**
5
- * What {@link withDefaults} returns: the full consumer contract, plus `supports()` and
6
- * `supportsReadOption()`.
5
+ * What {@link withDefaults} returns: the full consumer contract, plus `supports()`.
7
6
  *
8
7
  * `getAccountInfo` is narrowed to required. It is the one managed capability that
9
8
  * {@link CoinModuleApi} itself declares optional, and `withDefaults` always supplies it — so
@@ -12,13 +11,6 @@ import type { CoinModuleApi, Memo, MemoNotSupported, TxData, TxDataNotSupported
12
11
  */
13
12
  export type WithDefaultsResult<ConfigType extends CurrencyConfig, MemoType extends Memo = MemoNotSupported, TxDataType extends TxData = TxDataNotSupported> = CoinModuleApi<ConfigType, MemoType, TxDataType> & Required<Pick<CoinModuleApi<ConfigType, MemoType, TxDataType>, 'getAccountInfo'>> & {
14
13
  supports: (method: OptionalApiKey) => boolean;
15
- /**
16
- * Whether `method` honours the read `option`: the module implements the method and declares
17
- * the option in `readOptions`. When the method is implemented but does not declare the option,
18
- * an opted-in call rejects with an {@link InvalidParameterError}. When the method is not
19
- * implemented, every call throws `"<method> is not supported"`, as without the option.
20
- */
21
- supportsReadOption: (method: ReadOptionMethod, option: ReadOption) => boolean;
22
14
  };
23
15
  /**
24
16
  * Widens a {@link CoinModuleImpl} authoring value to the full {@link CoinModuleApi}
@@ -34,9 +26,6 @@ export type WithDefaultsResult<ConfigType extends CurrencyConfig, MemoType exten
34
26
  *
35
27
  * A capability method is considered implemented only when the author supplied a real
36
28
  * function — a `notSupported()` stub is treated as if the method had been omitted.
37
- *
38
- * `listOperations` and `getBlock` reject a call that sets a read option the module does not
39
- * declare in `readOptions` (see `ReadOptionsDeclaration`). Calls without it are unchanged.
40
29
  */
41
30
  export declare function withDefaults<ConfigType extends CurrencyConfig, MemoType extends Memo = MemoNotSupported, TxDataType extends TxData = TxDataNotSupported, Extra extends object = Record<never, never>>(impl: CoinModuleImpl<ConfigType, MemoType, TxDataType> & Extra): WithDefaultsResult<ConfigType, MemoType, TxDataType> & Extra;
42
31
  //# sourceMappingURL=withDefaults.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"withDefaults.d.ts","sourceRoot":"","sources":["../../src/api/withDefaults.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC/C,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,UAAU,EACV,gBAAgB,EAEjB,MAAM,QAAQ,CAAA;AACf,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAKhG;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,CAC5B,UAAU,SAAS,cAAc,EACjC,QAAQ,SAAS,IAAI,GAAG,gBAAgB,EACxC,UAAU,SAAS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AC,UAAU,EAAE,QAAQ,EAAE,UAAU,CAAC,GACjD,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,QAAQ,EAAE,UAAU,CAAC,EAAE,gBAAgB,CAAC,CAAC,GAAG;IAClF,QAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,OAAO,CAAA;CAC9C,CAAA;AAaH;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAC1B,UAAU,SAAS,cAAc,EACjC,QAAQ,SAAS,IAAI,GAAG,gBAAgB,EACxC,UAAU,SAAS,MAAM,GAAG,kBAAkB,EAC9C,KAAK,SAAS,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAE3C,IAAI,EAAE,cAAc,CAAC,UAAU,EAAE,QAAQ,EAAE,UAAU,CAAC,GAAG,KAAK,GAC7D,kBAAkB,CAAC,UAAU,EAAE,QAAQ,EAAE,UAAU,CAAC,GAAG,KAAK,CA4B9D"}
@@ -1,6 +1,5 @@
1
1
  // SPDX-FileCopyrightText: © 2024 LEDGER SAS
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import { InvalidParameterError } from '../errors';
4
3
  import { optionalApiKeys } from './impl';
5
4
  import { isNotSupportedStub, notSupported } from './notSupported';
6
5
  /**
@@ -13,24 +12,6 @@ import { isNotSupportedStub, notSupported } from './notSupported';
13
12
  function implemented(value) {
14
13
  return value === undefined || isNotSupportedStub(value) ? undefined : value;
15
14
  }
16
- function declares(readOptions, method, option) {
17
- return readOptions?.[method]?.includes(option) ?? false;
18
- }
19
- /**
20
- * Rejects an opted-in call to a method that does not declare the `feesAsset` read option.
21
- *
22
- * Both guarded methods take their options as the third argument. A call without the option goes
23
- * through with its arguments and its receiver unchanged: an implementation may read `this`.
24
- */
25
- function guardFeesAsset(method, fn, declared) {
26
- if (declared)
27
- return fn;
28
- return function (...args) {
29
- return args[2]?.feesAsset
30
- ? Promise.reject(new InvalidParameterError(`${method} does not support the feesAsset option`))
31
- : fn.apply(this, args);
32
- };
33
- }
34
15
  /**
35
16
  * Widens a {@link CoinModuleImpl} authoring value to the full {@link CoinModuleApi}
36
17
  * consumer contract by backfilling the capability methods the author omitted, and attaches
@@ -45,28 +26,14 @@ function guardFeesAsset(method, fn, declared) {
45
26
  *
46
27
  * A capability method is considered implemented only when the author supplied a real
47
28
  * function — a `notSupported()` stub is treated as if the method had been omitted.
48
- *
49
- * `listOperations` and `getBlock` reject a call that sets a read option the module does not
50
- * declare in `readOptions` (see `ReadOptionsDeclaration`). Calls without it are unchanged.
51
29
  */
52
30
  export function withDefaults(impl) {
53
31
  const implementedMethods = new Set(optionalApiKeys.filter((k) => implemented(impl[k]) !== undefined));
54
- // A stub stays the tagged stub, not a guarded wrapper: callers detect it as "not supported".
55
- // listOperations is required, but a read-only module built on notSupportedApi() may stub it.
56
- const listOperations = implemented(impl.listOperations);
57
- const getBlock = implemented(impl.getBlock);
58
- const supportsReadOption = (method, option) => (method === 'listOperations' ? listOperations !== undefined : getBlock !== undefined) &&
59
- declares(impl.readOptions, method, option);
60
32
  // Spread first so anything the module exposes beyond the API surface survives, then
61
33
  // override every capability method with either the real implementation or the default.
62
34
  return {
63
35
  ...impl,
64
- listOperations: listOperations
65
- ? guardFeesAsset('listOperations', listOperations, supportsReadOption('listOperations', 'feesAsset'))
66
- : impl.listOperations,
67
- getBlock: getBlock
68
- ? guardFeesAsset('getBlock', getBlock, supportsReadOption('getBlock', 'feesAsset'))
69
- : notSupported('getBlock'),
36
+ getBlock: implemented(impl.getBlock) ?? notSupported('getBlock'),
70
37
  getBlockInfo: implemented(impl.getBlockInfo) ?? notSupported('getBlockInfo'),
71
38
  getStakes: implemented(impl.getStakes) ?? notSupported('getStakes'),
72
39
  getRewards: implemented(impl.getRewards) ?? notSupported('getRewards'),
@@ -83,7 +50,6 @@ export function withDefaults(impl) {
83
50
  // of a throwing stub. Callers read `type` and branch on it.
84
51
  getAccountInfo: implemented(impl.getAccountInfo) ?? (() => Promise.resolve({ type: 'none' })),
85
52
  supports: (method) => implementedMethods.has(method),
86
- supportsReadOption,
87
53
  };
88
54
  }
89
55
  //# sourceMappingURL=withDefaults.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"withDefaults.js","sourceRoot":"","sources":["../../src/api/withDefaults.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,sCAAsC;AAWtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AACxC,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AA2BjE;;;;;;GAMG;AACH,SAAS,WAAW,CAAI,KAAoB;IAC1C,OAAO,KAAK,KAAK,SAAS,IAAI,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAA;AAC7E,CAAC;AAED,SAAS,QAAQ,CACf,WAA+C,EAC/C,MAAwB,EACxB,MAAkB;IAElB,OAAO,WAAW,EAAE,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,KAAK,CAAA;AACzD,CAAC;AAED;;;;;GAKG;AACH,SAAS,cAAc,CACrB,MAAwB,EACxB,EAAiC,EACjC,QAAiB;IAEjB,IAAI,QAAQ;QAAE,OAAO,EAAE,CAAA;IACvB,OAAO,UAAyB,GAAG,IAAU;QAC3C,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS;YACvB,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,qBAAqB,CAAC,GAAG,MAAM,wCAAwC,CAAC,CAAC;YAC9F,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IAC1B,CAAC,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,YAAY,CAM1B,IAA8D;IAE9D,MAAM,kBAAkB,GAAG,IAAI,GAAG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AAE,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,YAAY,CAAC,gBAAgB,CAAC;QAClF,eAAe,EAAE,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,YAAY,CAAC,iBAAiB,CAAC;QACrF,YAAY,EAAE,WAAW,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,YAAY,CAAC,cAAc,CAAC;QAC5E,qFAAqF;QACrF,yFAAyF;QACzF,4DAA4D;QAC5D,cAAc,EAAE,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;QAC7F,QAAQ,EAAE,CAAC,MAAsB,EAAW,EAAE,CAAC,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC;KAC9E,CAAA;AACH,CAAC"}
@@ -2,28 +2,34 @@ import type { CoinModuleImpl, OptionalApiKey } from '../api/impl';
2
2
  import type { Memo, TxData } from '../api/types';
3
3
  import type { Context, CurrencyConfig } from '../config';
4
4
  /**
5
- * What a module reports about the capabilities it does not implement, as a consumer sees it
6
- * through `withDefaults`. Meant to be asserted whole:
5
+ * What a module reports about its optional capabilities, as a consumer sees it through
6
+ * `withDefaults`. Meant to be asserted whole:
7
7
  *
8
8
  * ```ts
9
9
  * await expect(capabilityReport(createApi(), context)).resolves.toEqual({
10
- * unsupported: ['call', 'craftRawTransaction', 'getRewards', 'getValidators', 'register'],
10
+ * supported: ['getBlock', 'getBlockInfo', 'getStakes', 'validateAddress', 'validateIntent'],
11
11
  * inconsistent: [],
12
12
  * })
13
13
  * ```
14
14
  *
15
- * One expectation then covers what a module's api test used to spell out method by method:
16
- * that each capability is absent, that reaching it raises `"<name> is not supported"`, and
17
- * that `supports()` agrees. `toEqual` makes it exhaustive — a capability dropped or newly
18
- * implemented changes the list, so the test notices instead of silently still passing.
15
+ * `supported` lists what the module implements, so it changes only when the module does: a
16
+ * capability dropped or newly implemented changes the list, and the test notices instead of
17
+ * silently still passing. A capability the framework adds is not implemented by an existing
18
+ * module, so it leaves the list alone: a framework release that adds a capability does not break
19
+ * the modules' tests.
20
+ *
21
+ * Every other capability is reached, and must raise `"<name> is not supported"`; one that does
22
+ * not lands in `inconsistent`. An empty `inconsistent` therefore covers what a module's api test
23
+ * used to spell out method by method: that each absent capability raises its error, and that
24
+ * `supports()` agrees.
19
25
  *
20
26
  * It reads a module written either way: a `CoinModuleImpl` that omits its capabilities, or a
21
27
  * value built by spreading `notSupportedApi()`. Both are "not implemented" as far as
22
28
  * `supports()` is concerned, which is what this observes.
23
29
  */
24
30
  export type CapabilityReport = {
25
- /** Capabilities the module does not implement, sorted, each verified to raise its error. */
26
- unsupported: OptionalApiKey[];
31
+ /** Capabilities the module implements, sorted: those `supports()` reports present. */
32
+ supported: OptionalApiKey[];
27
33
  /**
28
34
  * Capabilities `supports()` calls absent but which did not raise `"<name> is not
29
35
  * supported"` when reached — a missing backfill, or an error naming another method.
@@ -1 +1 @@
1
- {"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/test-utils/capabilities.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjE,OAAO,KAAK,EAAiB,IAAI,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAQxD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,4FAA4F;IAC5F,WAAW,EAAE,cAAc,EAAE,CAAA;IAC7B;;;;OAIG;IACH,YAAY,EAAE,cAAc,EAAE,CAAA;CAC/B,CAAA;AAED;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CACpC,UAAU,SAAS,cAAc,EACjC,QAAQ,SAAS,IAAI,EACrB,UAAU,SAAS,MAAM,EAEzB,IAAI,EAAE,cAAc,CAAC,UAAU,EAAE,QAAQ,EAAE,UAAU,CAAC,EACtD,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,GAC3B,OAAO,CAAC,gBAAgB,CAAC,CAgC3B"}
1
+ {"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/test-utils/capabilities.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjE,OAAO,KAAK,EAAiB,IAAI,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAQxD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,sFAAsF;IACtF,SAAS,EAAE,cAAc,EAAE,CAAA;IAC3B;;;;OAIG;IACH,YAAY,EAAE,cAAc,EAAE,CAAA;CAC/B,CAAA;AAED;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CACpC,UAAU,SAAS,cAAc,EACjC,QAAQ,SAAS,IAAI,EACrB,UAAU,SAAS,MAAM,EAEzB,IAAI,EAAE,cAAc,CAAC,UAAU,EAAE,QAAQ,EAAE,UAAU,CAAC,EACtD,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,GAC3B,OAAO,CAAC,gBAAgB,CAAC,CAsC3B"}
@@ -16,11 +16,15 @@ const isMethod = (value) => typeof value === 'function';
16
16
  export async function capabilityReport(impl, context) {
17
17
  const resolved = withDefaults(impl);
18
18
  const asRecord = resolved;
19
- const unsupported = [];
19
+ const supported = [];
20
20
  const inconsistent = [];
21
21
  for (const name of optionalApiKeys) {
22
- if (name === 'getAccountInfo' || resolved.supports(name))
22
+ if (name === 'getAccountInfo')
23
23
  continue;
24
+ if (resolved.supports(name)) {
25
+ supported.push(name);
26
+ continue;
27
+ }
24
28
  const method = asRecord[name];
25
29
  if (!isMethod(method)) {
26
30
  inconsistent.push(name);
@@ -31,11 +35,12 @@ export async function capabilityReport(impl, context) {
31
35
  const raised = await Promise.resolve()
32
36
  .then(() => method(context))
33
37
  .then(() => undefined, (error) => (error instanceof Error ? error.message : String(error)));
34
- if (raised === `${name} is not supported`)
35
- unsupported.push(name);
36
- else
38
+ if (raised !== `${name} is not supported`)
37
39
  inconsistent.push(name);
38
40
  }
39
- return { unsupported: unsupported.sort(), inconsistent: inconsistent.sort() };
41
+ return {
42
+ supported: supported.sort(),
43
+ inconsistent: inconsistent.sort(),
44
+ };
40
45
  }
41
46
  //# sourceMappingURL=capabilities.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../src/test-utils/capabilities.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,sCAAsC;AAKtC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD,iFAAiF;AACjF,MAAM,QAAQ,GAAG,CAAC,KAAc,EAA4C,EAAE,CAC5E,OAAO,KAAK,KAAK,UAAU,CAAA;AAiC7B;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAKpC,IAAsD,EACtD,OAA4B;IAE5B,MAAM,QAAQ,GAEV,YAAY,CAAC,IAAI,CAAC,CAAA;IACtB,MAAM,QAAQ,GAA4B,QAAQ,CAAA;IAElD,MAAM,WAAW,GAAqB,EAAE,CAAA;IACxC,MAAM,YAAY,GAAqB,EAAE,CAAA;IAEzC,KAAK,MAAM,IAAI,IAAI,eAAe,EAAE,CAAC;QACnC,IAAI,IAAI,KAAK,gBAAgB,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC;YAAE,SAAQ;QAElE,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;QAC7B,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACtB,YAAY,CAAC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AAqB,EAAE,CAAA;IAEzC,KAAK,MAAM,IAAI,IAAI,eAAe,EAAE,CAAC;QACnC,IAAI,IAAI,KAAK,gBAAgB;YAAE,SAAQ;QACvC,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAC5B,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACpB,SAAQ;QACV,CAAC;QAED,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;QAC7B,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACtB,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACvB,SAAQ;QACV,CAAC;QAED,0FAA0F;QAC1F,gFAAgF;QAChF,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,OAAO,EAAE;aACnC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;aAC3B,IAAI,CACH,GAAG,EAAE,CAAC,SAAS,EACf,CAAC,KAAc,EAAE,EAAE,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAC7E,CAAA;QAEH,IAAI,MAAM,KAAK,GAAG,IAAI,mBAAmB;YAAE,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACpE,CAAC;IAED,OAAO;QACL,SAAS,EAAE,SAAS,CAAC,IAAI,EAAE;QAC3B,YAAY,EAAE,YAAY,CAAC,IAAI,EAAE;KAClC,CAAA;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/coin-module-framework",
3
- "version": "11.4.0",
3
+ "version": "13.1.0",
4
4
  "description": "Ledger framework for Coin integration",
5
5
  "keywords": [
6
6
  "Ledger",
package/src/api/impl.ts CHANGED
@@ -88,24 +88,6 @@ export type ApiMethodKeysAreExhaustive = AssertNever<
88
88
  Exclude<keyof CoinModuleApi<CurrencyConfig>, ApiMethodKey>
89
89
  >
90
90
 
91
- /** An opt-in read option: a field of the method's options that changes what it returns. */
92
- export type ReadOption = 'feesAsset'
93
-
94
- /** A method that takes a {@link ReadOption}. */
95
- export type ReadOptionMethod = 'listOperations' | 'getBlock'
96
-
97
- /**
98
- * The read options a module honours, per method.
99
- *
100
- * A read option changes the meaning of an existing output, and JavaScript ignores arguments a
101
- * method does not read. A module must therefore declare each option it honours: `withDefaults`
102
- * rejects an opted-in call to a method that does not declare it, instead of returning the
103
- * legacy output.
104
- */
105
- export type ReadOptionsDeclaration = {
106
- readonly [M in ReadOptionMethod]?: readonly ReadOption[]
107
- }
108
-
109
91
  /**
110
92
  * Authoring type for a coin-module implementation.
111
93
  *
@@ -129,7 +111,4 @@ export type CoinModuleImpl<
129
111
  MemoType extends Memo = MemoNotSupported,
130
112
  TxDataType extends TxData = TxDataNotSupported,
131
113
  > = Omit<CoinModuleApi<ConfigType, MemoType, TxDataType>, OptionalApiKey> &
132
- Partial<Pick<CoinModuleApi<ConfigType, MemoType, TxDataType>, OptionalApiKey>> & {
133
- /** The read options this module honours. See {@link ReadOptionsDeclaration}. */
134
- readOptions?: ReadOptionsDeclaration
135
- }
114
+ Partial<Pick<CoinModuleApi<ConfigType, MemoType, TxDataType>, OptionalApiKey>>
package/src/api/types.ts CHANGED
@@ -88,9 +88,10 @@ export type Operation<MemoType extends Memo = MemoNotSupported> = {
88
88
  /**
89
89
  * The transaction this operation belongs to.
90
90
  *
91
- * When the caller sets {@link ListOperationsOptions.feesAsset}, these rules apply:
91
+ * Fee rules:
92
92
  *
93
- * 1. When {@link tx.feesAsset} is absent, the fee is in the native coin.
93
+ * 1. Modules set {@link tx.feesAsset}, also when the fee is in the native coin. While it is optional, an absent
94
+ * {@link tx.feesAsset} means the native coin.
94
95
  * 2. A consumer debits {@link tx.fees} once, in {@link tx.feesAsset}, from {@link tx.feesPayer}. A failed transaction
95
96
  * also pays.
96
97
  * 3. Operations never include the fee movement, in any asset. When a chain emits the fee as token transfers, the
@@ -107,9 +108,10 @@ export type Operation<MemoType extends Memo = MemoNotSupported> = {
107
108
  fees: bigint
108
109
 
109
110
  /**
110
- * The asset that paid {@link fees}. Absent means the native coin.
111
+ * The asset that paid {@link fees}.
111
112
  *
112
- * Set only when the caller sets {@link ListOperationsOptions.feesAsset}.
113
+ * Modules must set it, also when the fee is in the native coin. It is optional until every module sets it, and
114
+ * will then become required. Until then, absent means the native coin.
113
115
  */
114
116
  feesAsset?: AssetInfo
115
117
 
@@ -156,9 +158,10 @@ export type Block = {
156
158
  /**
157
159
  * A transaction belonging to a {@link Block}, not specific to a particular account/address.
158
160
  *
159
- * When the caller sets {@link GetBlockOptions.feesAsset}, these rules apply:
161
+ * Fee rules:
160
162
  *
161
- * 1. When {@link feesAsset} is absent, the fee is in the native coin.
163
+ * 1. Modules set {@link feesAsset}, also when the fee is in the native coin. While it is optional, an absent
164
+ * {@link feesAsset} means the native coin.
162
165
  * 2. A consumer debits {@link fees} once, in {@link feesAsset}, from {@link feesPayer}. A failed transaction also
163
166
  * pays.
164
167
  * 3. {@link operations} never include the fee movement, in any asset. When a chain emits the fee as token transfers,
@@ -199,9 +202,10 @@ export type BlockTransaction = {
199
202
  fees: bigint
200
203
 
201
204
  /**
202
- * The asset that paid {@link fees}. Absent means the native coin.
205
+ * The asset that paid {@link fees}.
203
206
  *
204
- * Set only when the caller sets {@link GetBlockOptions.feesAsset}.
207
+ * Modules must set it, also when the fee is in the native coin. It is optional until every module sets it, and
208
+ * will then become required. Until then, absent means the native coin.
205
209
  */
206
210
  feesAsset?: AssetInfo
207
211
 
@@ -259,6 +263,23 @@ export type Balance = {
259
263
 
260
264
  /** The {@link Stake} this balance is part of, if any. */
261
265
  stake?: Stake
266
+
267
+ /**
268
+ * A module-defined partition of one asset inside one account, for a chain that holds the same
269
+ * asset in several pools with different spend rules (a privacy chain's public and shielded pools).
270
+ * Opaque to the framework: an identity, never interpreted.
271
+ *
272
+ * Consumers aggregate the entries of one asset (`Σ value`, `Σ (value − locked)`) and never pick
273
+ * one. A pool that cannot fund a transaction reports `locked === value`. A pool is not an asset and
274
+ * never produces a sub-account. Pool and privacy metadata do not replace stake partition identity
275
+ * and are not, together with the asset, a unique key for balance entries.
276
+ *
277
+ * Absent: no pool distinction is specified; separate stake partitions may still exist.
278
+ */
279
+ pool?: string
280
+
281
+ /** The entry is held privately and is not visible on-chain. Absent: public. */
282
+ private?: boolean
262
283
  }
263
284
 
264
285
  /** The actions that are possible to do from a {@link Stake}. */
@@ -431,6 +452,8 @@ export type TransactionIntent<
431
452
  recipient: string
432
453
  amount: bigint
433
454
  asset: AssetInfo
455
+ /** The {@link Balance.pool} that funds this transaction. Absent: the module chooses. */
456
+ pool?: string
434
457
  useAllAmount?: boolean
435
458
  senderPublicKey?: string
436
459
  sequence?: bigint
@@ -601,26 +624,6 @@ export type ListOperationsOptions = {
601
624
  * Implementation must raise a "not supported" error if order is set and not supported.
602
625
  */
603
626
  order?: 'asc' | 'desc'
604
-
605
- /**
606
- * Report the asset that paid each fee, as `feesAsset` in {@link Operation.tx}, under the rules stated there.
607
- *
608
- * When it is not set, the output is the legacy one: `fees` is read as native. A module that honours this option
609
- * declares it in `CoinModuleImpl.readOptions`; otherwise `withDefaults` rejects the call.
610
- */
611
- feesAsset?: boolean
612
- }
613
-
614
- /** Options for {@link CoinModuleApi#getBlock}. */
615
- export type GetBlockOptions = {
616
- /**
617
- * Report the asset that paid each fee in {@link BlockTransaction.feesAsset}, under the rules on
618
- * {@link BlockTransaction}.
619
- *
620
- * When it is not set, the output is the legacy one: `fees` is read as native. A module that honours this option
621
- * declares it in `CoinModuleImpl.readOptions`; otherwise `withDefaults` rejects the call.
622
- */
623
- feesAsset?: boolean
624
627
  }
625
628
 
626
629
  /** A network validator */
@@ -795,15 +798,10 @@ export type CoinModuleApi<
795
798
  *
796
799
  * @param context the {@link Context} carrying the coin config accessor and logger
797
800
  * @param height the block height to query
798
- * @param options see {@link GetBlockOptions}
799
801
  * @returns the complete block with transactions
800
802
  * @throws "not supported" if the blockchain does not support querying full blocks
801
803
  */
802
- getBlock: (
803
- context: Context<ConfigType>,
804
- height: number,
805
- options?: GetBlockOptions
806
- ) => Promise<Block>
804
+ getBlock: (context: Context<ConfigType>, height: number) => Promise<Block>
807
805
 
808
806
  /**
809
807
  * Perform a direct, read-only smart-contract call against the underlying node or indexer.