@ledgerhq/coin-canton 0.12.0-nightly.20251217023943 → 0.12.0-nightly.20251218023953

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.
@@ -327,6 +327,10 @@ export type OperationInfo =
327
327
  };
328
328
  };
329
329
 
330
+ export const SEPARATOR = "____";
331
+
332
+ export const getKey = (id: string, adminId: string) => `${id}${SEPARATOR}${adminId}`;
333
+
330
334
  const getGatewayUrl = (currency: CryptoCurrency) => coinConfig.getCoinConfig(currency).gatewayUrl;
331
335
  const getNodeId = (currency: CryptoCurrency) => {
332
336
  const overrideNodeId = getEnv("CANTON_NODE_ID_OVERRIDE");
@@ -427,25 +431,23 @@ export function clearIsTopologyChangeRequiredCache(currency: CryptoCurrency, pub
427
431
  }
428
432
 
429
433
  export type InstrumentInfo = {
430
- instrument_id: string;
431
- display_name?: string;
434
+ id: string;
435
+ admin: string;
432
436
  };
433
437
 
434
- export type InstrumentsResponse = {
435
- instruments: InstrumentInfo[];
436
- };
438
+ export type InstrumentsResponse = InstrumentInfo[];
437
439
 
438
- export async function getEnabledInstruments(currency: CryptoCurrency): Promise<string[]> {
440
+ export async function getEnabledInstruments(currency: CryptoCurrency): Promise<Set<string>> {
439
441
  try {
440
442
  const { data } = await gatewayNetwork<InstrumentsResponse>({
441
443
  method: "GET",
442
444
  url: `${getGatewayUrl(currency)}/v1/node/${getNodeId(currency)}/instruments`,
443
445
  });
444
- return data.instruments.map(instrument => instrument.instrument_id);
446
+ return new Set(data.map(({ id, admin }) => getKey(id, admin)));
445
447
  } catch (error) {
446
448
  // If API fails, return empty array (fail-safe: only native instrument will work)
447
449
  console.error("Failed to fetch enabled instruments:", error);
448
- return [];
450
+ return new Set();
449
451
  }
450
452
  }
451
453
 
@@ -0,0 +1,5 @@
1
+ import type { SupportedFeatures } from "@ledgerhq/coin-framework/features/types";
2
+
3
+ export const supportedFeatures: SupportedFeatures = {
4
+ blockchain_txs: ["send"],
5
+ };