@ledgerhq/coin-module-framework 0.1.9 → 1.0.5

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 (108) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/lib/api/errors.d.ts +4 -0
  3. package/lib/api/errors.d.ts.map +1 -0
  4. package/lib/api/errors.js +10 -0
  5. package/lib/api/errors.js.map +1 -0
  6. package/lib/api/index.d.ts +7 -0
  7. package/lib/api/index.d.ts.map +1 -0
  8. package/lib/api/index.js +23 -0
  9. package/lib/api/index.js.map +1 -0
  10. package/lib/api/types.d.ts +568 -0
  11. package/lib/api/types.d.ts.map +1 -0
  12. package/lib/api/types.js +3 -0
  13. package/lib/api/types.js.map +1 -0
  14. package/lib/config.d.ts +43 -0
  15. package/lib/config.d.ts.map +1 -0
  16. package/lib/config.js +21 -0
  17. package/lib/config.js.map +1 -0
  18. package/lib/currencies/formatCurrencyUnit.d.ts +2 -0
  19. package/lib/currencies/formatCurrencyUnit.d.ts.map +1 -0
  20. package/lib/currencies/formatCurrencyUnit.js +7 -0
  21. package/lib/currencies/formatCurrencyUnit.js.map +1 -0
  22. package/lib/currencies/index.d.ts +3 -0
  23. package/lib/currencies/index.d.ts.map +1 -0
  24. package/lib/currencies/index.js +9 -0
  25. package/lib/currencies/index.js.map +1 -0
  26. package/lib/currencies/parseCurrencyUnit.d.ts +2 -0
  27. package/lib/currencies/parseCurrencyUnit.d.ts.map +1 -0
  28. package/lib/currencies/parseCurrencyUnit.js +6 -0
  29. package/lib/currencies/parseCurrencyUnit.js.map +1 -0
  30. package/lib/errors.d.ts +5 -0
  31. package/lib/errors.d.ts.map +1 -0
  32. package/lib/errors.js +7 -0
  33. package/lib/errors.js.map +1 -0
  34. package/lib/features/types.d.ts +46 -0
  35. package/lib/features/types.d.ts.map +1 -0
  36. package/lib/features/types.js +18 -0
  37. package/lib/features/types.js.map +1 -0
  38. package/lib/index.d.ts +6 -0
  39. package/lib/index.d.ts.map +1 -0
  40. package/lib/index.js +40 -0
  41. package/lib/index.js.map +1 -0
  42. package/lib/setup.d.ts +2 -0
  43. package/lib/setup.d.ts.map +1 -0
  44. package/lib/setup.js +6 -0
  45. package/lib/setup.js.map +1 -0
  46. package/lib/test/utils.d.ts +20 -0
  47. package/lib/test/utils.d.ts.map +1 -0
  48. package/lib/test/utils.js +3 -0
  49. package/lib/test/utils.js.map +1 -0
  50. package/lib/utils.d.ts +6 -0
  51. package/lib/utils.d.ts.map +1 -0
  52. package/lib/utils.js +18 -0
  53. package/lib/utils.js.map +1 -0
  54. package/lib-es/api/errors.d.ts +4 -0
  55. package/lib-es/api/errors.d.ts.map +1 -0
  56. package/lib-es/api/errors.js +6 -0
  57. package/lib-es/api/errors.js.map +1 -0
  58. package/lib-es/api/index.d.ts +7 -0
  59. package/lib-es/api/index.d.ts.map +1 -0
  60. package/lib-es/api/index.js +7 -0
  61. package/lib-es/api/index.js.map +1 -0
  62. package/lib-es/api/types.d.ts +568 -0
  63. package/lib-es/api/types.d.ts.map +1 -0
  64. package/lib-es/api/types.js +2 -0
  65. package/lib-es/api/types.js.map +1 -0
  66. package/lib-es/config.d.ts +43 -0
  67. package/lib-es/config.d.ts.map +1 -0
  68. package/lib-es/config.js +19 -0
  69. package/lib-es/config.js.map +1 -0
  70. package/lib-es/currencies/formatCurrencyUnit.d.ts +2 -0
  71. package/lib-es/currencies/formatCurrencyUnit.d.ts.map +1 -0
  72. package/lib-es/currencies/formatCurrencyUnit.js +2 -0
  73. package/lib-es/currencies/formatCurrencyUnit.js.map +1 -0
  74. package/lib-es/currencies/index.d.ts +3 -0
  75. package/lib-es/currencies/index.d.ts.map +1 -0
  76. package/lib-es/currencies/index.js +3 -0
  77. package/lib-es/currencies/index.js.map +1 -0
  78. package/lib-es/currencies/parseCurrencyUnit.d.ts +2 -0
  79. package/lib-es/currencies/parseCurrencyUnit.d.ts.map +1 -0
  80. package/lib-es/currencies/parseCurrencyUnit.js +2 -0
  81. package/lib-es/currencies/parseCurrencyUnit.js.map +1 -0
  82. package/lib-es/errors.d.ts +5 -0
  83. package/lib-es/errors.d.ts.map +1 -0
  84. package/lib-es/errors.js +4 -0
  85. package/lib-es/errors.js.map +1 -0
  86. package/lib-es/features/types.d.ts +46 -0
  87. package/lib-es/features/types.d.ts.map +1 -0
  88. package/lib-es/features/types.js +14 -0
  89. package/lib-es/features/types.js.map +1 -0
  90. package/lib-es/index.d.ts +6 -0
  91. package/lib-es/index.d.ts.map +1 -0
  92. package/lib-es/index.js +5 -0
  93. package/lib-es/index.js.map +1 -0
  94. package/lib-es/setup.d.ts +2 -0
  95. package/lib-es/setup.d.ts.map +1 -0
  96. package/lib-es/setup.js +4 -0
  97. package/lib-es/setup.js.map +1 -0
  98. package/lib-es/test/utils.d.ts +20 -0
  99. package/lib-es/test/utils.d.ts.map +1 -0
  100. package/lib-es/test/utils.js +2 -0
  101. package/lib-es/test/utils.js.map +1 -0
  102. package/lib-es/utils.d.ts +6 -0
  103. package/lib-es/utils.d.ts.map +1 -0
  104. package/lib-es/utils.js +13 -0
  105. package/lib-es/utils.js.map +1 -0
  106. package/package.json +1 -1
  107. package/tsconfig.build.json +5 -2
  108. package/tsconfig.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,eAAe,GAAG;IAC5B,YAAY,EAAE,OAAO,CAAA;IACrB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,MAAM,CAAC,EAAE,iBAAiB,CAAA;CAC3B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAE9B,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,aAAa,GAAG,MAAM,CAAA;IAElD,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IAIZ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M,EACnB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,KACb,OAAO,CAAC,kBAAkB,CAAC,CAAA;IAEhC;;;;;;;;;OASG;IACH,YAAY,EAAE,CACZ,iBAAiB,EAAE,iBAAiB,CAAC,QAAQ,EAAE,UAAU,CAAC,EAC1D,oBAAoB,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,KAC/C,OAAO,CAAC,aAAa,CAAC,CAAA;IAE3B;;;;;;;OAOG;IACH,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAErF;;;;;;;OAOG;IACH,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,eAAe,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAE7E;;;;;;;OAOG;IACH,cAAc,EAAE,CACd,iBAAiB,EAAE,iBAAiB,CAAC,QAAQ,EAAE,UAAU,CAAC,EAC1D,QAAQ,EAAE,OAAO,EAAE,EACnB,UAAU,CAAC,EAAE,aAAa,KACvB,OAAO,CAAC,qBAAqB,CAAC,CAAA;IAEnC;;;;;OAKG;IACH,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAErD;;;;;;OAMG;IACH,eAAe,EAAE,CACf,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,OAAO,CAAC,mCAAmC,CAAC,KACrD,OAAO,CAAC,OAAO,CAAC,CAAA;CACtB,CAAA"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,43 @@
1
+ import { CryptoCurrency, CryptoCurrencyId } from '@ledgerhq/types-cryptoassets';
2
+ import type { FeatureConfig } from './features/types';
3
+ type ConfigStatus = {
4
+ type: 'active';
5
+ features?: FeatureConfig[];
6
+ } | {
7
+ type: 'under_maintenance';
8
+ message?: string;
9
+ } | {
10
+ type: 'migration';
11
+ chain: CryptoCurrencyId;
12
+ from: string;
13
+ to: string;
14
+ link: string;
15
+ } | {
16
+ type: 'feature_unavailable';
17
+ link: string;
18
+ feature: 'history' | 'swap' | 'token_history' | 'send_and_receive' | 'send' | 'receive' | 'sending_tokens' | 'receiving_tokens' | 'staking' | 'claiming_staking_rewards';
19
+ } | {
20
+ type: 'will_be_deprecated';
21
+ deprecated_date: string;
22
+ link: string;
23
+ } | {
24
+ type: 'deprecated';
25
+ };
26
+ type Banner = {
27
+ isDisplay: boolean;
28
+ bannerText: string;
29
+ bannerLink?: string;
30
+ bannerLinkText?: string;
31
+ };
32
+ export type CurrencyConfig = {
33
+ status: ConfigStatus;
34
+ customBanner?: Banner;
35
+ [key: string]: unknown;
36
+ };
37
+ export type CoinConfig<T extends CurrencyConfig> = (currency?: CryptoCurrency) => T;
38
+ declare function buildCoinConfig<T extends CurrencyConfig>(): {
39
+ setCoinConfig: (config: CoinConfig<T>) => void;
40
+ getCoinConfig: (currency?: CryptoCurrency) => T;
41
+ };
42
+ export default buildCoinConfig;
43
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAE/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAErD,KAAK,YAAY,GACb;IACE,IAAI,EAAE,QAAQ,CAAA;IACd,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAA;CAC3B,GACD;IACE,IAAI,EAAE,mBAAmB,CAAA;IACzB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,GACD;IACE,IAAI,EAAE,WAAW,CAAA;IACjB,KAAK,EAAE,gBAAgB,CAAA;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;CACb,GACD;IACE,IAAI,EAAE,qBAAqB,CAAA;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EACH,SAAS,GACT,MAAM,GACN,eAAe,GACf,kBAAkB,GAClB,MAAM,GACN,SAAS,GACT,gBAAgB,GAChB,kBAAkB,GAClB,SAAS,GACT,0BAA0B,CAAA;CAC/B,GACD;IACE,IAAI,EAAE,oBAAoB,CAAA;IAC1B,eAAe,EAAE,MAAM,CAAA;IACvB,IAAI,EAAE,MAAM,CAAA;CACb,GACD;IACE,IAAI,EAAE,YAAY,CAAA;CACnB,CAAA;AAEL,KAAK,MAAM,GAAG;IACZ,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,YAAY,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,cAAc,IAAI,CAAC,QAAQ,CAAC,EAAE,cAAc,KAAK,CAAC,CAAA;AAEnF,iBAAS,eAAe,CAAC,CAAC,SAAS,cAAc;4BAGhB,UAAU,CAAC,CAAC,CAAC,KAAG,IAAI;+BAIjB,cAAc,KAAG,CAAC;EAYrD;AAED,eAAe,eAAe,CAAA"}
package/lib/config.js ADDED
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const errors_1 = require("./errors");
4
+ function buildCoinConfig() {
5
+ let coinConfig;
6
+ const setCoinConfig = (config) => {
7
+ coinConfig = config;
8
+ };
9
+ const getCoinConfig = (currency) => {
10
+ if (!coinConfig) {
11
+ throw new errors_1.MissingCoinConfig();
12
+ }
13
+ return coinConfig(currency);
14
+ };
15
+ return {
16
+ setCoinConfig,
17
+ getCoinConfig,
18
+ };
19
+ }
20
+ exports.default = buildCoinConfig;
21
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;AACA,qCAA4C;AA0D5C,SAAS,eAAe;IACtB,IAAI,UAAqC,CAAA;IAEzC,MAAM,aAAa,GAAG,CAAC,MAAqB,EAAQ,EAAE;QACpD,UAAU,GAAG,MAAM,CAAA;IACrB,CAAC,CAAA;IAED,MAAM,aAAa,GAAG,CAAC,QAAyB,EAAK,EAAE;QACrD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,0BAAiB,EAAE,CAAA;QAC/B,CAAC;QAED,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAA;IAC7B,CAAC,CAAA;IAED,OAAO;QACL,aAAa;QACb,aAAa;KACd,CAAA;AACH,CAAC;AAED,kBAAe,eAAe,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { formatCurrencyUnit, formatCurrencyUnitFragment, type formatCurrencyUnitOptions, type FormatterValue, } from '@ledgerhq/live-currency-format';
2
+ //# sourceMappingURL=formatCurrencyUnit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatCurrencyUnit.d.ts","sourceRoot":"","sources":["../../src/currencies/formatCurrencyUnit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,cAAc,GACpB,MAAM,gCAAgC,CAAA"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatCurrencyUnitFragment = exports.formatCurrencyUnit = void 0;
4
+ var live_currency_format_1 = require("@ledgerhq/live-currency-format");
5
+ Object.defineProperty(exports, "formatCurrencyUnit", { enumerable: true, get: function () { return live_currency_format_1.formatCurrencyUnit; } });
6
+ Object.defineProperty(exports, "formatCurrencyUnitFragment", { enumerable: true, get: function () { return live_currency_format_1.formatCurrencyUnitFragment; } });
7
+ //# sourceMappingURL=formatCurrencyUnit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatCurrencyUnit.js","sourceRoot":"","sources":["../../src/currencies/formatCurrencyUnit.ts"],"names":[],"mappings":";;;AAAA,uEAKuC;AAJrC,0HAAA,kBAAkB,OAAA;AAClB,kIAAA,0BAA0B,OAAA"}
@@ -0,0 +1,3 @@
1
+ export { parseCurrencyUnit } from './parseCurrencyUnit';
2
+ export { formatCurrencyUnit, formatCurrencyUnitFragment, type formatCurrencyUnitOptions, type FormatterValue, } from './formatCurrencyUnit';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/currencies/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,cAAc,GACpB,MAAM,sBAAsB,CAAA"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatCurrencyUnitFragment = exports.formatCurrencyUnit = exports.parseCurrencyUnit = void 0;
4
+ var parseCurrencyUnit_1 = require("./parseCurrencyUnit");
5
+ Object.defineProperty(exports, "parseCurrencyUnit", { enumerable: true, get: function () { return parseCurrencyUnit_1.parseCurrencyUnit; } });
6
+ var formatCurrencyUnit_1 = require("./formatCurrencyUnit");
7
+ Object.defineProperty(exports, "formatCurrencyUnit", { enumerable: true, get: function () { return formatCurrencyUnit_1.formatCurrencyUnit; } });
8
+ Object.defineProperty(exports, "formatCurrencyUnitFragment", { enumerable: true, get: function () { return formatCurrencyUnit_1.formatCurrencyUnitFragment; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/currencies/index.ts"],"names":[],"mappings":";;;AAAA,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA;AAC1B,2DAK6B;AAJ3B,wHAAA,kBAAkB,OAAA;AAClB,gIAAA,0BAA0B,OAAA"}
@@ -0,0 +1,2 @@
1
+ export { parseCurrencyUnit } from '@ledgerhq/live-currency-format';
2
+ //# sourceMappingURL=parseCurrencyUnit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseCurrencyUnit.d.ts","sourceRoot":"","sources":["../../src/currencies/parseCurrencyUnit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseCurrencyUnit = void 0;
4
+ var live_currency_format_1 = require("@ledgerhq/live-currency-format");
5
+ Object.defineProperty(exports, "parseCurrencyUnit", { enumerable: true, get: function () { return live_currency_format_1.parseCurrencyUnit; } });
6
+ //# sourceMappingURL=parseCurrencyUnit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseCurrencyUnit.js","sourceRoot":"","sources":["../../src/currencies/parseCurrencyUnit.ts"],"names":[],"mappings":";;;AAAA,uEAAkE;AAAzD,yHAAA,iBAAiB,OAAA"}
@@ -0,0 +1,5 @@
1
+ /** When a coin-module has no CoinConfig setted */
2
+ export declare const MissingCoinConfig: import("@ledgerhq/errors/lib/helpers").LedgerErrorConstructor<{
3
+ [key: string]: unknown;
4
+ }>;
5
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAEA,kDAAkD;AAClD,eAAO,MAAM,iBAAiB;;EAA8C,CAAA"}
package/lib/errors.js ADDED
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MissingCoinConfig = void 0;
4
+ const errors_1 = require("@ledgerhq/errors");
5
+ /** When a coin-module has no CoinConfig setted */
6
+ exports.MissingCoinConfig = (0, errors_1.createCustomErrorClass)('MissingCoinConfig');
7
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;AAAA,6CAAyD;AAEzD,kDAAkD;AACrC,QAAA,iBAAiB,GAAG,IAAA,+BAAsB,EAAC,mBAAmB,CAAC,CAAA"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Feature IDs as defined in https://ledgerhq.atlassian.net/wiki/spaces/CF/pages/6125551933/Coin+modules+-+ADR-003+-+Features+support
3
+ * These represent the capabilities/features a coin module can support
4
+ */
5
+ export type FeatureId = 'blockchain_txs' | 'staking_txs';
6
+ /**
7
+ * Intent types for blockchain_txs feature
8
+ */
9
+ export type BlockchainTxsIntent = 'send';
10
+ /**
11
+ * Intent types for staking_txs feature
12
+ */
13
+ export type StakingTxsIntent = 'delegate' | 'undelegate' | 'redelegate' | 'claimReward' | 'withdraw';
14
+ /**
15
+ * Mapping from feature ID to its supported intents
16
+ */
17
+ export type FeatureIntentMap = {
18
+ blockchain_txs: BlockchainTxsIntent;
19
+ staking_txs: StakingTxsIntent;
20
+ };
21
+ /**
22
+ * A supported feature declaration in a coin module
23
+ * Maps feature IDs to their supported intents
24
+ * Example: { "blockchain_txs": ["send"], "staking_txs": ["delegate", "claimReward"] }
25
+ */
26
+ export type SupportedFeatures = Partial<Record<FeatureId, string[]>>;
27
+ /**
28
+ * Feature status in liveconfig
29
+ */
30
+ export type FeatureStatus = 'active' | 'inactive';
31
+ /**
32
+ * Feature configuration in liveconfig
33
+ */
34
+ export type FeatureConfig = {
35
+ id: FeatureId;
36
+ status: FeatureStatus;
37
+ };
38
+ /**
39
+ * Helper function to check if a feature is supported
40
+ */
41
+ export declare function hasFeature(supportedFeatures: SupportedFeatures, featureId: FeatureId): boolean;
42
+ /**
43
+ * Helper function to check if an intent is supported for a feature
44
+ */
45
+ export declare function hasIntent(supportedFeatures: SupportedFeatures, featureId: FeatureId, intent: string): boolean;
46
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/features/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,SAAS,GAEjB,gBAAgB,GAEhB,aAAa,CAAA;AAEjB;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAA;AAExC;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,YAAY,GAAG,YAAY,GAAG,aAAa,GAAG,UAAU,CAAA;AAEpG;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,cAAc,EAAE,mBAAmB,CAAA;IACnC,WAAW,EAAE,gBAAgB,CAAA;CAC9B,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,CAAA;AAEpE;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,UAAU,CAAA;AAEjD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,SAAS,CAAA;IACb,MAAM,EAAE,aAAa,CAAA;CACtB,CAAA;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,iBAAiB,EAAE,iBAAiB,EAAE,SAAS,EAAE,SAAS,GAAG,OAAO,CAE9F;AAED;;GAEG;AACH,wBAAgB,SAAS,CACvB,iBAAiB,EAAE,iBAAiB,EACpC,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,GACb,OAAO,CAGT"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hasFeature = hasFeature;
4
+ exports.hasIntent = hasIntent;
5
+ /**
6
+ * Helper function to check if a feature is supported
7
+ */
8
+ function hasFeature(supportedFeatures, featureId) {
9
+ return featureId in supportedFeatures;
10
+ }
11
+ /**
12
+ * Helper function to check if an intent is supported for a feature
13
+ */
14
+ function hasIntent(supportedFeatures, featureId, intent) {
15
+ const intents = supportedFeatures[featureId];
16
+ return intents?.includes(intent) ?? false;
17
+ }
18
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/features/types.ts"],"names":[],"mappings":";;AAmDA,gCAEC;AAKD,8BAOC;AAjBD;;GAEG;AACH,SAAgB,UAAU,CAAC,iBAAoC,EAAE,SAAoB;IACnF,OAAO,SAAS,IAAI,iBAAiB,CAAA;AACvC,CAAC;AAED;;GAEG;AACH,SAAgB,SAAS,CACvB,iBAAoC,EACpC,SAAoB,EACpB,MAAc;IAEd,MAAM,OAAO,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAA;IAC5C,OAAO,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,KAAK,CAAA;AAC3C,CAAC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import * as api from './api';
2
+ declare const _default: {
3
+ api: typeof api;
4
+ };
5
+ export default _default;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,OAAO,CAAA;;;;AAE5B,wBAEC"}
package/lib/index.js ADDED
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ const api = __importStar(require("./api"));
37
+ exports.default = {
38
+ api,
39
+ };
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4B;AAE5B,kBAAe;IACb,GAAG;CACJ,CAAA"}
package/lib/setup.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":""}
package/lib/setup.js ADDED
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const bignumber_js_1 = require("bignumber.js");
4
+ const live_env_1 = require("@ledgerhq/live-env");
5
+ bignumber_js_1.BigNumber.set({ DECIMAL_PLACES: (0, live_env_1.getEnv)('BIG_NUMBER_DECIMAL_PLACES') });
6
+ //# sourceMappingURL=setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.js","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":";;AAAA,+CAAwC;AACxC,iDAA2C;AAE3C,wBAAS,CAAC,GAAG,CAAC,EAAE,cAAc,EAAE,IAAA,iBAAM,EAAC,2BAA2B,CAAC,EAAE,CAAC,CAAA"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Recursively makes all properties optional.
3
+ * Arrays keep their element type (but each element is deeply partial).
4
+ * Primitives and built-in value types (Date, RegExp) are preserved as-is.
5
+ */
6
+ export type DeepPartial<T> = T extends (infer U)[] ? DeepPartial<U>[] : T extends Date | RegExp ? T : T extends object ? {
7
+ [K in keyof T]?: DeepPartial<T[K]>;
8
+ } : T;
9
+ /**
10
+ * Re-types a function so its return value is wrapped in `Promise<DeepPartial<…>>`,
11
+ * while keeping the original parameter types intact.
12
+ *
13
+ * Useful for typing Jest mock functions that return partial RPC/API data:
14
+ * ```ts
15
+ * const mock = jest.fn() as jest.MockedFunction<DeepPartialReturn<SomeApi["method"]>>;
16
+ * mock.mockResolvedValue({ onlyTheFieldsWeNeed: true });
17
+ * ```
18
+ */
19
+ export type DeepPartialReturn<F extends (...args: never[]) => unknown> = (...args: Parameters<F>) => Promise<DeepPartial<Awaited<ReturnType<F>>>>;
20
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/test/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAC9C,WAAW,CAAC,CAAC,CAAC,EAAE,GAChB,CAAC,SAAS,IAAI,GAAG,MAAM,GACrB,CAAC,GACD,CAAC,SAAS,MAAM,GACd;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACtC,CAAC,CAAA;AAET;;;;;;;;;GASG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,IAAI,CACvE,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KACnB,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/test/utils.ts"],"names":[],"mappings":""}
package/lib/utils.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import BigNumber from 'bignumber.js';
2
+ import { SendTransactionIntent, StakingTransactionIntent, TransactionIntent } from './api';
3
+ export declare function fromBigNumberToBigInt<T>(bigNumber: BigNumber | undefined, defaultValue?: T): bigint | T;
4
+ export declare function isSendTransactionIntent(tx: TransactionIntent): tx is SendTransactionIntent;
5
+ export declare function isStakingTransactionIntent(tx: TransactionIntent): tx is StakingTransactionIntent;
6
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAA;AACpC,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAE1F,wBAAgB,qBAAqB,CAAC,CAAC,EACrC,SAAS,EAAE,SAAS,GAAG,SAAS,EAChC,YAAY,CAAC,EAAE,CAAC,GACf,MAAM,GAAG,CAAC,CAKZ;AAED,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,iBAAiB,GAAG,EAAE,IAAI,qBAAqB,CAE1F;AAED,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,iBAAiB,GAAG,EAAE,IAAI,wBAAwB,CAEhG"}
package/lib/utils.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fromBigNumberToBigInt = fromBigNumberToBigInt;
4
+ exports.isSendTransactionIntent = isSendTransactionIntent;
5
+ exports.isStakingTransactionIntent = isStakingTransactionIntent;
6
+ function fromBigNumberToBigInt(bigNumber, defaultValue) {
7
+ if (bigNumber != null) {
8
+ return BigInt(bigNumber.toFixed());
9
+ }
10
+ return defaultValue;
11
+ }
12
+ function isSendTransactionIntent(tx) {
13
+ return tx.intentType === 'transaction';
14
+ }
15
+ function isStakingTransactionIntent(tx) {
16
+ return tx.intentType === 'staking';
17
+ }
18
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;AAGA,sDAQC;AAED,0DAEC;AAED,gEAEC;AAhBD,SAAgB,qBAAqB,CACnC,SAAgC,EAChC,YAAgB;IAEhB,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;QACtB,OAAO,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAA;IACpC,CAAC;IACD,OAAO,YAAiB,CAAA;AAC1B,CAAC;AAED,SAAgB,uBAAuB,CAAC,EAAqB;IAC3D,OAAO,EAAE,CAAC,UAAU,KAAK,aAAa,CAAA;AACxC,CAAC;AAED,SAAgB,0BAA0B,CAAC,EAAqB;IAC9D,OAAO,EAAE,CAAC,UAAU,KAAK,SAAS,CAAA;AACpC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare class IncorrectTypeError extends Error {
2
+ constructor(message?: string);
3
+ }
4
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/api/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,kBAAmB,SAAQ,KAAK;gBAC/B,OAAO,CAAC,EAAE,MAAM;CAG7B"}
@@ -0,0 +1,6 @@
1
+ export class IncorrectTypeError extends Error {
2
+ constructor(message) {
3
+ super(`IncorrectType: ${message}`);
4
+ }
5
+ }
6
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/api/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAC3C,YAAY,OAAgB;QAC1B,KAAK,CAAC,kBAAkB,OAAO,EAAE,CAAC,CAAA;IACpC,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Module related to all API exposition constraints and helper.
3
+ * One consumer of this API is Alpaca.
4
+ */
5
+ export * from './errors';
6
+ export * from './types';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Module related to all API exposition constraints and helper.
3
+ * One consumer of this API is Alpaca.
4
+ */
5
+ export * from './errors';
6
+ export * from './types';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA"}