@onekeyfe/hwk-adapter-core 1.2.8-alpha.110 → 1.2.8-alpha.112

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.
package/dist/index.d.mts CHANGED
@@ -1163,7 +1163,12 @@ interface SaveDeviceBindingRequest extends UiRequestOperationAttribution {
1163
1163
  }>;
1164
1164
  extra?: HardwareCallExtra;
1165
1165
  }
1166
- type BindBleDeviceParams = Pick<SaveDeviceBindingRequest, 'identity' | 'extra'>;
1166
+ type BindBleDeviceParams = Pick<SaveDeviceBindingRequest, 'identity' | 'extra'> & {
1167
+ /** Ledger: other recorded chains, tried in order only when the previous chain's app is missing. */
1168
+ fallbackIdentities?: Extract<WalletIdentity, {
1169
+ vendor: 'ledger';
1170
+ }>[];
1171
+ };
1167
1172
  interface DeviceBindingStatus {
1168
1173
  selectionRequestId: string;
1169
1174
  status: 'verifying' | 'saved' | 'failed' | 'cancelled';
package/dist/index.d.ts CHANGED
@@ -1163,7 +1163,12 @@ interface SaveDeviceBindingRequest extends UiRequestOperationAttribution {
1163
1163
  }>;
1164
1164
  extra?: HardwareCallExtra;
1165
1165
  }
1166
- type BindBleDeviceParams = Pick<SaveDeviceBindingRequest, 'identity' | 'extra'>;
1166
+ type BindBleDeviceParams = Pick<SaveDeviceBindingRequest, 'identity' | 'extra'> & {
1167
+ /** Ledger: other recorded chains, tried in order only when the previous chain's app is missing. */
1168
+ fallbackIdentities?: Extract<WalletIdentity, {
1169
+ vendor: 'ledger';
1170
+ }>[];
1171
+ };
1167
1172
  interface DeviceBindingStatus {
1168
1173
  selectionRequestId: string;
1169
1174
  status: 'verifying' | 'saved' | 'failed' | 'cancelled';
package/dist/index.js CHANGED
@@ -565,6 +565,15 @@ function rehydrateConnectorError(error) {
565
565
  ..._nullishCoalesce(params, () => ( {}))
566
566
  });
567
567
  }
568
+ function withChildConnectionType(event, data, connectionType) {
569
+ if (event !== "device-connect" && event !== "features") return data;
570
+ const { device } = data;
571
+ if (device.connectionType) return data;
572
+ return {
573
+ ...data,
574
+ device: { ...device, connectionType }
575
+ };
576
+ }
568
577
  function isDeviceUnavailableError(error) {
569
578
  const typed = error;
570
579
  if (typed.code === 10100 /* DeviceNotFound */ || typed.code === 10101 /* DeviceDisconnected */) {
@@ -763,7 +772,7 @@ function createCombinedConnector(connectors) {
763
772
  },
764
773
  on: (event, handler) => {
765
774
  const attached = connectors.map((child) => {
766
- const forward = (data) => handler(data);
775
+ const forward = (data) => handler(withChildConnectionType(event, data, child.connectionType));
767
776
  child.on(event, forward);
768
777
  return { child, handler: forward };
769
778
  });