Socket
Socket
Sign inDemoInstall

@onekeyfe/hd-core

Package Overview
Dependencies
Maintainers
2
Versions
251
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@onekeyfe/hd-core - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

5

dist/api/BTCGetAddress.d.ts

@@ -1,8 +0,9 @@

import { Address, GetAddress } from '@onekeyfe/hd-transport/src/types/messages';
import { GetAddress } from '@onekeyfe/hd-transport/src/types/messages';
import { BaseMethod } from './BaseMethod';
import { BTCAddress } from '../types/api/btcGetAddress';
export default class BTCGetAddress extends BaseMethod<GetAddress[]> {
hasBundle: boolean;
init(): void;
run(): Promise<Address | Address[]>;
run(): Promise<BTCAddress | BTCAddress[]>;
}
//# sourceMappingURL=BTCGetAddress.d.ts.map

@@ -1,8 +0,9 @@

import { GetPublicKey, PublicKey } from '@onekeyfe/hd-transport/src/types/messages';
import { GetPublicKey } from '@onekeyfe/hd-transport/src/types/messages';
import { BaseMethod } from './BaseMethod';
import { BTCPublicKey } from '../types/api/btcGetPublicKey';
export default class BTCGetPublicKey extends BaseMethod<GetPublicKey[]> {
hasBundle: boolean;
init(): void;
run(): Promise<PublicKey | PublicKey[]>;
run(): Promise<BTCPublicKey | BTCPublicKey[]>;
}
//# sourceMappingURL=BTCGetPublicKey.d.ts.map

@@ -1,8 +0,9 @@

import { EthereumAddress, EthereumGetAddress } from '@onekeyfe/hd-transport/src/types/messages';
import { EthereumGetAddress } from '@onekeyfe/hd-transport/src/types/messages';
import { BaseMethod } from './BaseMethod';
import { EVMAddress } from '../types/api/evmGetAddress';
export default class EvmGetAddress extends BaseMethod<EthereumGetAddress[]> {
hasBundle: boolean;
init(): void;
run(): Promise<EthereumAddress | EthereumAddress[]>;
run(): Promise<EVMAddress | EVMAddress[]>;
}
//# sourceMappingURL=EVMGetAddress.d.ts.map

@@ -1,8 +0,9 @@

import { EthereumGetPublicKey, EthereumPublicKey } from '@onekeyfe/hd-transport/src/types/messages';
import { EthereumGetPublicKey } from '@onekeyfe/hd-transport/src/types/messages';
import { BaseMethod } from './BaseMethod';
import { EVMPublicKey } from '../types/api/evmGetPublicKey';
export default class EVMGetPublicKey extends BaseMethod<EthereumGetPublicKey[]> {
hasBundle: boolean;
init(): void;
run(): Promise<EthereumPublicKey | EthereumPublicKey[]>;
run(): Promise<EVMPublicKey | EVMPublicKey[]>;
}
//# sourceMappingURL=EVMGetPublicKey.d.ts.map

8

dist/api/EVMSignTransaction.d.ts
import { EthereumTxRequest } from '@onekeyfe/hd-transport/src/types/messages';
import { BaseMethod } from './BaseMethod';
import { EVMTransaction, EVMTransactionEIP1559 } from '../types/api/evmSignTransaction';
declare type EVMSignedTx = {
v: string;
r: string;
s: string;
};
import { EVMSignedTx, EVMTransaction, EVMTransactionEIP1559 } from '../types/api/evmSignTransaction';
export default class EVMSignTransaction extends BaseMethod {

@@ -19,3 +14,2 @@ addressN: number[];

}
export {};
//# sourceMappingURL=EVMSignTransaction.d.ts.map

@@ -10,2 +10,3 @@ import { BaseMethod } from './BaseMethod';

onekey_version: string;
ble_name: string;
ble_ver: string;

@@ -12,0 +13,0 @@ ble_enable: boolean;

@@ -11,3 +11,4 @@ import { ChangeOutputScriptType, InputScriptType } from '@onekeyfe/hd-transport/src/types/messages';

export declare const getOutputScriptType: (path?: number[] | undefined) => ChangeOutputScriptType;
export declare const serializedPath: (path: Array<number>) => string;
export declare const validatePath: (path: string | Array<number>, length?: number, base?: boolean) => Array<number>;
//# sourceMappingURL=pathUtils.d.ts.map

@@ -8,2 +8,3 @@ import { BaseMethod } from './BaseMethod';

connectId: string;
deviceType: string;
path: string;

@@ -10,0 +11,0 @@ session?: string | null | undefined;

import EventEmitter, { EventEmitter as EventEmitter$1 } from 'events';
import { OneKeyDeviceInfo, Messages, Transport } from '@onekeyfe/hd-transport';
import { Messages, Transport, OneKeyDeviceInfo } from '@onekeyfe/hd-transport';
export { Messages as PROTO } from '@onekeyfe/hd-transport';
import { EthereumAddress, EthereumPublicKey, EthereumMessageSignature, Success as Success$1, Address, MultisigRedeemScriptType, InputScriptType, PublicKey, MessageSignature, TxInputType, TxOutputType, PrevInput, TxOutputBinType, TxInput, RecoveryDeviceType } from '@onekeyfe/hd-transport/src/types/messages';
import { EthereumPublicKey, EthereumMessageSignature, Success as Success$1, Address, MultisigRedeemScriptType, InputScriptType, PublicKey, MessageSignature, TxInputType, TxOutputType, PrevInput, TxOutputBinType, TxInput, RecoveryDeviceType, SafetyCheckLevel } from '@onekeyfe/hd-transport/src/types/messages';

@@ -26,4 +26,2 @@ interface CommonParams {

declare function searchDevices(): Response<OneKeyDeviceInfo[]>;
declare const ERROR_CODES: {

@@ -145,2 +143,3 @@ Method_InvalidParameter: string;

label: string;
name: string;
error?: typeof undefined;

@@ -153,2 +152,9 @@ mode: DeviceMode;

};
declare type SearchDevice = {
connectId: string | null;
uuid: string;
deviceId: string | null;
deviceType: IDeviceType;
name: string;
};
declare type Device$1 = KnownDevice;

@@ -161,2 +167,4 @@ declare type Features = Messages.Features;

declare function searchDevices(): Response<SearchDevice[]>;
declare function getFeatures(connectId?: string): Response<Features>;

@@ -209,2 +217,6 @@

declare type EVMAddress = {
path: string;
address: string;
};
declare type EVMGetAddressParams = {

@@ -214,7 +226,10 @@ path: string | number[];

};
declare function evmGetAddress(connectId: string, params: CommonParams & EVMGetAddressParams): Response<EthereumAddress>;
declare function evmGetAddress(connectId: string, params: CommonParams & EVMGetAddressParams): Response<EVMAddress>;
declare function evmGetAddress(connectId: string, params: CommonParams & {
bundle?: EVMGetAddressParams[];
}): Response<Array<EthereumAddress>>;
}): Response<Array<EVMAddress>>;
declare type EVMPublicKey = {
path: string;
} & EthereumPublicKey;
declare type EVMGetPublicKeyParams = {

@@ -224,6 +239,6 @@ path: string | number[];

};
declare function evmGetPublicKey(connectId: string, params: CommonParams & EVMGetPublicKeyParams): Response<EthereumPublicKey>;
declare function evmGetPublicKey(connectId: string, params: CommonParams & EVMGetPublicKeyParams): Response<EVMPublicKey>;
declare function evmGetPublicKey(connectId: string, params: CommonParams & {
bundle?: EVMGetPublicKeyParams[];
}): Response<Array<EthereumPublicKey>>;
}): Response<Array<EVMPublicKey>>;

@@ -243,3 +258,8 @@ declare type EVMSignMessageParams = {

interface EVMTransaction {
declare type EVMSignedTx = {
v: string;
r: string;
s: string;
};
declare type EVMTransaction = {
to: string;

@@ -255,3 +275,3 @@ value: string;

txType?: number;
}
};
declare type EVMAccessList = {

@@ -277,3 +297,3 @@ address: string;

};
declare function evmSignTransaction(connectId: string, params: CommonParams & EVMSignTransactionParams): Response<EthereumMessageSignature>;
declare function evmSignTransaction(connectId: string, params: CommonParams & EVMSignTransactionParams): Response<EVMSignedTx>;

@@ -318,2 +338,5 @@ declare type EthereumSignTypedDataTypeProperty = {

declare type BTCAddress = {
path: string;
} & Address;
declare type BTCGetAddressParams = {

@@ -326,7 +349,10 @@ path: string | number[];

};
declare function btcGetAddress(connectId: string, params: CommonParams & BTCGetAddressParams): Response<Address>;
declare function btcGetAddress(connectId: string, params: CommonParams & BTCGetAddressParams): Response<BTCAddress>;
declare function btcGetAddress(connectId: string, params: CommonParams & {
bundle?: BTCGetAddressParams[];
}): Response<Array<Address>>;
}): Response<Array<BTCAddress>>;
declare type BTCPublicKey = {
path: string;
} & PublicKey;
declare type BTCGetPublicKeyParams = {

@@ -338,6 +364,6 @@ path: string | number[];

};
declare function btcGetPublicKey(connectId: string, params: CommonParams & BTCGetPublicKeyParams): Response<PublicKey>;
declare function btcGetPublicKey(connectId: string, params: CommonParams & BTCGetPublicKeyParams): Response<BTCPublicKey>;
declare function btcGetPublicKey(connectId: string, params: CommonParams & {
bundle?: BTCGetPublicKeyParams[];
}): Response<Array<PublicKey>>;
}): Response<Array<BTCPublicKey>>;

@@ -457,3 +483,15 @@ declare type BTCSignMessageParams = {

declare function deviceSettings(connectId: string): Response<Success$1>;
declare type DeviceSettingsParams = {
language?: string;
label?: string;
usePassphrase?: boolean;
homescreen?: string;
passphraseSource?: number;
autoLockDelayMs?: number;
displayRotation?: number;
passphraseAlwaysOnDevice?: boolean;
safetyChecks?: SafetyCheckLevel;
experimentalFeatures?: boolean;
};
declare function deviceSettings(connectId: string, params: CommonParams & DeviceSettingsParams): Response<Success$1>;

@@ -837,2 +875,2 @@ declare type DeviceFlagsParams = {

export { AssetsMap, CORE_EVENT, CallMethod, CallMethodAnyResponse, CallMethodKeys, CallMethodPayload, CallMethodResponse, CallMethodUnion, CommonParams, ConnectSettings, Core, CoreApi, CoreMessage, DEFAULT_PRIORITY, DEVICE, DataManager, Deferred, Device$1 as Device, DeviceButtonRequestPayload, DeviceMode, DeviceStatus, DeviceTypeMap, errors as ERRORS, Features, FirmwareRange, FirmwareRelease, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceType, IFRAME, IFirmwareReleaseInfo, IFrameBridge, IFrameCallMessage, IFrameEvent, IFrameEventMessage, IFrameInit, ILocale, ITransportStatus, IVersionArray, KnownDevice, MethodResponseMessage, PostMessageEvent, RESPONSE_EVENT, ReleaseInfo, RemoteConfigResponse, Response, Success, TransportReleaseStatus, UI_EVENT, UI_REQUEST, UI_RESPONSE, UiEvent, UiEventMessage, UiPromise, UiPromiseResponse, UiRequestDeviceAction, UiResponseEvent, UiResponseMessage, UiResponsePin, UnavailableCapabilities, UnavailableCapability, Unsuccessful, VersionArray, corsValidator, create, createErrorMessage, createIFrameMessage, createResponseMessage, createUiMessage, createUiResponse, HardwareSdk as default, enableLog, getEnv, getTimeStamp, httpRequest, init as initCore, initLog, isValidVersionArray, isValidVersionString, normalizeVersionArray, parseConnectSettings, parseMessage, versionCompare, versionSplit };
export { AssetsMap, CORE_EVENT, CallMethod, CallMethodAnyResponse, CallMethodKeys, CallMethodPayload, CallMethodResponse, CallMethodUnion, CommonParams, ConnectSettings, Core, CoreApi, CoreMessage, DEFAULT_PRIORITY, DEVICE, DataManager, Deferred, Device$1 as Device, DeviceButtonRequestPayload, DeviceMode, DeviceStatus, DeviceTypeMap, errors as ERRORS, Features, FirmwareRange, FirmwareRelease, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceType, IFRAME, IFirmwareReleaseInfo, IFrameBridge, IFrameCallMessage, IFrameEvent, IFrameEventMessage, IFrameInit, ILocale, ITransportStatus, IVersionArray, KnownDevice, MethodResponseMessage, PostMessageEvent, RESPONSE_EVENT, ReleaseInfo, RemoteConfigResponse, Response, SearchDevice, Success, TransportReleaseStatus, UI_EVENT, UI_REQUEST, UI_RESPONSE, UiEvent, UiEventMessage, UiPromise, UiPromiseResponse, UiRequestDeviceAction, UiResponseEvent, UiResponseMessage, UiResponsePin, UnavailableCapabilities, UnavailableCapability, Unsuccessful, VersionArray, corsValidator, create, createErrorMessage, createIFrameMessage, createResponseMessage, createUiMessage, createUiResponse, HardwareSdk as default, enableLog, getEnv, getTimeStamp, httpRequest, init as initCore, initLog, isValidVersionArray, isValidVersionString, normalizeVersionArray, parseConnectSettings, parseMessage, versionCompare, versionSplit };
import { Address, InputScriptType, MultisigRedeemScriptType } from '@onekeyfe/hd-transport/src/types/messages';
import type { CommonParams, Response } from '../params';
export declare type BTCAddress = {
path: string;
} & Address;
export declare type BTCGetAddressParams = {

@@ -10,6 +13,6 @@ path: string | number[];

};
export declare function btcGetAddress(connectId: string, params: CommonParams & BTCGetAddressParams): Response<Address>;
export declare function btcGetAddress(connectId: string, params: CommonParams & BTCGetAddressParams): Response<BTCAddress>;
export declare function btcGetAddress(connectId: string, params: CommonParams & {
bundle?: BTCGetAddressParams[];
}): Response<Array<Address>>;
}): Response<Array<BTCAddress>>;
//# sourceMappingURL=btcGetAddress.d.ts.map
import { InputScriptType, PublicKey } from '@onekeyfe/hd-transport/src/types/messages';
import type { CommonParams, Response } from '../params';
export declare type BTCPublicKey = {
path: string;
} & PublicKey;
export declare type BTCGetPublicKeyParams = {

@@ -9,6 +12,6 @@ path: string | number[];

};
export declare function btcGetPublicKey(connectId: string, params: CommonParams & BTCGetPublicKeyParams): Response<PublicKey>;
export declare function btcGetPublicKey(connectId: string, params: CommonParams & BTCGetPublicKeyParams): Response<BTCPublicKey>;
export declare function btcGetPublicKey(connectId: string, params: CommonParams & {
bundle?: BTCGetPublicKeyParams[];
}): Response<Array<PublicKey>>;
}): Response<Array<BTCPublicKey>>;
//# sourceMappingURL=btcGetPublicKey.d.ts.map
import { SafetyCheckLevel, Success } from '@onekeyfe/hd-transport/src/types/messages';
import type { Response } from '../params';
import type { CommonParams, Response } from '../params';
export declare type DeviceSettingsParams = {

@@ -15,3 +15,3 @@ language?: string;

};
export declare function deviceSettings(connectId: string): Response<Success>;
export declare function deviceSettings(connectId: string, params: CommonParams & DeviceSettingsParams): Response<Success>;
//# sourceMappingURL=deviceSettings.d.ts.map

@@ -1,3 +0,6 @@

import { EthereumAddress } from '@onekeyfe/hd-transport/src/types/messages';
import type { CommonParams, Response } from '../params';
export declare type EVMAddress = {
path: string;
address: string;
};
export declare type EVMGetAddressParams = {

@@ -7,6 +10,6 @@ path: string | number[];

};
export declare function evmGetAddress(connectId: string, params: CommonParams & EVMGetAddressParams): Response<EthereumAddress>;
export declare function evmGetAddress(connectId: string, params: CommonParams & EVMGetAddressParams): Response<EVMAddress>;
export declare function evmGetAddress(connectId: string, params: CommonParams & {
bundle?: EVMGetAddressParams[];
}): Response<Array<EthereumAddress>>;
}): Response<Array<EVMAddress>>;
//# sourceMappingURL=evmGetAddress.d.ts.map
import { EthereumPublicKey } from '@onekeyfe/hd-transport/src/types/messages';
import type { CommonParams, Response } from '../params';
export declare type EVMPublicKey = {
path: string;
} & EthereumPublicKey;
export declare type EVMGetPublicKeyParams = {

@@ -7,6 +10,6 @@ path: string | number[];

};
export declare function evmGetPublicKey(connectId: string, params: CommonParams & EVMGetPublicKeyParams): Response<EthereumPublicKey>;
export declare function evmGetPublicKey(connectId: string, params: CommonParams & EVMGetPublicKeyParams): Response<EVMPublicKey>;
export declare function evmGetPublicKey(connectId: string, params: CommonParams & {
bundle?: EVMGetPublicKeyParams[];
}): Response<Array<EthereumPublicKey>>;
}): Response<Array<EVMPublicKey>>;
//# sourceMappingURL=evmGetPublicKey.d.ts.map

@@ -1,4 +0,8 @@

import { EthereumMessageSignature } from '@onekeyfe/hd-transport/src/types/messages';
import type { CommonParams, Response } from '../params';
export interface EVMTransaction {
export declare type EVMSignedTx = {
v: string;
r: string;
s: string;
};
export declare type EVMTransaction = {
to: string;

@@ -14,3 +18,3 @@ value: string;

txType?: number;
}
};
export declare type EVMAccessList = {

@@ -36,3 +40,3 @@ address: string;

};
export declare function evmSignTransaction(connectId: string, params: CommonParams & EVMSignTransactionParams): Response<EthereumMessageSignature>;
export declare function evmSignTransaction(connectId: string, params: CommonParams & EVMSignTransactionParams): Response<EVMSignedTx>;
//# sourceMappingURL=evmSignTransaction.d.ts.map

@@ -1,4 +0,4 @@

import { OneKeyDeviceInfo as DeviceDescriptor } from '@onekeyfe/hd-transport';
import { SearchDevice } from '../device';
import { Response } from '../params';
export declare function searchDevices(): Response<DeviceDescriptor[]>;
export declare function searchDevices(): Response<SearchDevice[]>;
//# sourceMappingURL=searchDevices.d.ts.map

@@ -16,2 +16,3 @@ import type { PROTO } from '../constants';

label: string;
name: string;
error?: typeof undefined;

@@ -24,2 +25,9 @@ mode: DeviceMode;

};
export declare type SearchDevice = {
connectId: string | null;
uuid: string;
deviceId: string | null;
deviceType: IDeviceType;
name: string;
};
export declare type Device = KnownDevice;

@@ -26,0 +34,0 @@ export declare type Features = PROTO.Features;

@@ -8,2 +8,3 @@ import type { Features, IVersionArray, IDeviceType } from '../types';

onekey_version: string;
ble_name: string;
ble_ver: string;

@@ -10,0 +11,0 @@ ble_enable: boolean;

{
"name": "@onekeyfe/hd-core",
"version": "0.0.1",
"version": "0.0.2",
"description": "> TODO: description",

@@ -28,3 +28,3 @@ "author": "OneKey",

"dependencies": {
"@onekeyfe/hd-transport": "*",
"@onekeyfe/hd-transport": "^0.0.2",
"axios": "^0.27.2",

@@ -39,3 +39,3 @@ "bignumber.js": "^9.0.2",

},
"gitHead": "20ce0ad2bd0388f9286be7b08cb76d94946a48c1"
"gitHead": "a28144ec2bdc835cb6af342fe1599f7a0cdc779f"
}

@@ -1,7 +0,7 @@

import { Address, GetAddress } from '@onekeyfe/hd-transport/src/types/messages';
import { GetAddress } from '@onekeyfe/hd-transport/src/types/messages';
import { UI_REQUEST } from '../constants/ui-request';
import { getScriptType, validatePath } from './helpers/pathUtils';
import { getScriptType, serializedPath, validatePath } from './helpers/pathUtils';
import { BaseMethod } from './BaseMethod';
import { validateParams } from './helpers/paramsValidator';
import { BTCGetAddressParams } from '../types/api/btcGetAddress';
import { BTCAddress, BTCGetAddressParams } from '../types/api/btcGetAddress';
import { getCoinInfo } from './helpers/btcParamsUtils';

@@ -57,3 +57,3 @@

async run() {
const responses: Address[] = [];
const responses: BTCAddress[] = [];

@@ -67,3 +67,6 @@ for (let i = 0; i < this.params.length; i++) {

responses.push(res.message);
responses.push({
path: serializedPath(param.address_n),
...res.message,
});
}

@@ -70,0 +73,0 @@

@@ -1,4 +0,4 @@

import { GetPublicKey, PublicKey } from '@onekeyfe/hd-transport/src/types/messages';
import { GetPublicKey } from '@onekeyfe/hd-transport/src/types/messages';
import { UI_REQUEST } from '../constants/ui-request';
import { getScriptType, validatePath } from './helpers/pathUtils';
import { getScriptType, serializedPath, validatePath } from './helpers/pathUtils';
import { BaseMethod } from './BaseMethod';

@@ -8,2 +8,3 @@ import { validateParams } from './helpers/paramsValidator';

import { getCoinInfo } from './helpers/btcParamsUtils';
import { BTCPublicKey } from '../types/api/btcGetPublicKey';

@@ -57,3 +58,3 @@ export default class BTCGetPublicKey extends BaseMethod<GetPublicKey[]> {

async run() {
const responses: PublicKey[] = [];
const responses: BTCPublicKey[] = [];

@@ -67,3 +68,6 @@ for (let i = 0; i < this.params.length; i++) {

responses.push(res.message);
responses.push({
path: serializedPath(param.address_n),
...res.message,
});
}

@@ -70,0 +74,0 @@

@@ -1,7 +0,7 @@

import { EthereumAddress, EthereumGetAddress } from '@onekeyfe/hd-transport/src/types/messages';
import { EthereumGetAddress } from '@onekeyfe/hd-transport/src/types/messages';
import { UI_REQUEST } from '../constants/ui-request';
import { validatePath } from './helpers/pathUtils';
import { serializedPath, validatePath } from './helpers/pathUtils';
import { BaseMethod } from './BaseMethod';
import { validateParams } from './helpers/paramsValidator';
import { EVMGetAddressParams } from '../types/api/evmGetAddress';
import { EVMAddress, EVMGetAddressParams } from '../types/api/evmGetAddress';

@@ -40,3 +40,3 @@ export default class EvmGetAddress extends BaseMethod<EthereumGetAddress[]> {

async run() {
const responses: EthereumAddress[] = [];
const responses: EVMAddress[] = [];

@@ -50,3 +50,8 @@ for (let i = 0; i < this.params.length; i++) {

responses.push(res.message);
const { address } = res.message;
responses.push({
path: serializedPath(param.address_n),
address,
});
}

@@ -53,0 +58,0 @@

@@ -1,7 +0,7 @@

import { EthereumGetPublicKey, EthereumPublicKey } from '@onekeyfe/hd-transport/src/types/messages';
import { EthereumGetPublicKey } from '@onekeyfe/hd-transport/src/types/messages';
import { UI_REQUEST } from '../constants/ui-request';
import { validatePath } from './helpers/pathUtils';
import { serializedPath, validatePath } from './helpers/pathUtils';
import { BaseMethod } from './BaseMethod';
import { validateParams } from './helpers/paramsValidator';
import { EVMGetPublicKeyParams } from '../types/api/evmGetPublicKey';
import { EVMGetPublicKeyParams, EVMPublicKey } from '../types/api/evmGetPublicKey';

@@ -40,3 +40,3 @@ export default class EVMGetPublicKey extends BaseMethod<EthereumGetPublicKey[]> {

async run() {
const responses: EthereumPublicKey[] = [];
const responses: EVMPublicKey[] = [];

@@ -54,3 +54,6 @@ for (let i = 0; i < this.params.length; i++) {

responses.push(res.message);
responses.push({
path: serializedPath(param.address_n),
...res.message,
});
}

@@ -57,0 +60,0 @@

@@ -12,2 +12,3 @@ import {

import {
EVMSignedTx,
EVMSignTransactionParams,

@@ -21,8 +22,2 @@ EVMTransaction,

type EVMSignedTx = {
v: string;
r: string;
s: string;
};
export default class EVMSignTransaction extends BaseMethod {

@@ -29,0 +24,0 @@ addressN: number[] = [];

@@ -87,2 +87,15 @@ /* eslint-disable no-bitwise */

export const serializedPath = (path: Array<number>): string => {
const pathStr = path
.map((p: number) => {
if (p & HD_HARDENED) {
return `${p & ~HD_HARDENED}'`;
}
return p;
})
.join('/');
return `m/${pathStr}`;
};
export const validatePath = (

@@ -89,0 +102,0 @@ path: string | Array<number>,

@@ -26,3 +26,8 @@ import { BaseMethod } from './BaseMethod';

if (env === 'react-native') {
return devicesDescriptor.map(device => ({ ...device, connectId: device.id }));
return devicesDescriptor.map(device => ({
...device,
connectId: device.id,
// 蓝牙场景只有 classic 能被搜索到
deviceType: 'classic',
}));
}

@@ -29,0 +34,0 @@

@@ -122,2 +122,6 @@ import EventEmitter from 'events';

path: this.originalDescriptor.path,
name:
this.features.ble_name ||
this.features.label ||
`OneKey ${getDeviceType(this.features).toUpperCase()}`,
label: getDeviceLabel(this.features),

@@ -124,0 +128,0 @@ mode: this.getMode(),

@@ -8,2 +8,6 @@ import {

export type BTCAddress = {
path: string;
} & Address;
export type BTCGetAddressParams = {

@@ -20,3 +24,3 @@ path: string | number[];

params: CommonParams & BTCGetAddressParams
): Response<Address>;
): Response<BTCAddress>;

@@ -26,2 +30,2 @@ export declare function btcGetAddress(

params: CommonParams & { bundle?: BTCGetAddressParams[] }
): Response<Array<Address>>;
): Response<Array<BTCAddress>>;
import { InputScriptType, PublicKey } from '@onekeyfe/hd-transport/src/types/messages';
import type { CommonParams, Response } from '../params';
export type BTCPublicKey = {
path: string;
} & PublicKey;
export type BTCGetPublicKeyParams = {

@@ -14,3 +18,3 @@ path: string | number[];

params: CommonParams & BTCGetPublicKeyParams
): Response<PublicKey>;
): Response<BTCPublicKey>;

@@ -20,2 +24,2 @@ export declare function btcGetPublicKey(

params: CommonParams & { bundle?: BTCGetPublicKeyParams[] }
): Response<Array<PublicKey>>;
): Response<Array<BTCPublicKey>>;
import { SafetyCheckLevel, Success } from '@onekeyfe/hd-transport/src/types/messages';
import type { Response } from '../params';
import type { CommonParams, Response } from '../params';

@@ -17,2 +17,5 @@ export type DeviceSettingsParams = {

export declare function deviceSettings(connectId: string): Response<Success>;
export declare function deviceSettings(
connectId: string,
params: CommonParams & DeviceSettingsParams
): Response<Success>;

@@ -1,4 +0,8 @@

import { EthereumAddress } from '@onekeyfe/hd-transport/src/types/messages';
import type { CommonParams, Response } from '../params';
export type EVMAddress = {
path: string;
address: string;
};
export type EVMGetAddressParams = {

@@ -12,3 +16,3 @@ path: string | number[];

params: CommonParams & EVMGetAddressParams
): Response<EthereumAddress>;
): Response<EVMAddress>;

@@ -18,2 +22,2 @@ export declare function evmGetAddress(

params: CommonParams & { bundle?: EVMGetAddressParams[] }
): Response<Array<EthereumAddress>>;
): Response<Array<EVMAddress>>;
import { EthereumPublicKey } from '@onekeyfe/hd-transport/src/types/messages';
import type { CommonParams, Response } from '../params';
export type EVMPublicKey = {
path: string;
} & EthereumPublicKey;
export type EVMGetPublicKeyParams = {

@@ -12,3 +16,3 @@ path: string | number[];

params: CommonParams & EVMGetPublicKeyParams
): Response<EthereumPublicKey>;
): Response<EVMPublicKey>;

@@ -18,2 +22,2 @@ export declare function evmGetPublicKey(

params: CommonParams & { bundle?: EVMGetPublicKeyParams[] }
): Response<Array<EthereumPublicKey>>;
): Response<Array<EVMPublicKey>>;

@@ -1,5 +0,10 @@

import { EthereumMessageSignature } from '@onekeyfe/hd-transport/src/types/messages';
import type { CommonParams, Response } from '../params';
export interface EVMTransaction {
export type EVMSignedTx = {
v: string;
r: string;
s: string;
};
export type EVMTransaction = {
to: string;

@@ -15,3 +20,3 @@ value: string;

txType?: number;
}
};

@@ -44,2 +49,2 @@ export type EVMAccessList = {

params: CommonParams & EVMSignTransactionParams
): Response<EthereumMessageSignature>;
): Response<EVMSignedTx>;

@@ -1,4 +0,5 @@

import { OneKeyDeviceInfo as DeviceDescriptor } from '@onekeyfe/hd-transport';
import { SearchDevice } from '../device';
import { Response } from '../params';
export declare function searchDevices(): Response<DeviceDescriptor[]>;
export declare function searchDevices(): Response<SearchDevice[]>;

@@ -23,2 +23,3 @@ import type { PROTO } from '../constants';

label: string;
name: string;
error?: typeof undefined;

@@ -32,2 +33,10 @@ mode: DeviceMode;

export type SearchDevice = {
connectId: string | null;
uuid: string;
deviceId: string | null;
deviceType: IDeviceType;
name: string;
};
// export type UnknownDevice = {

@@ -34,0 +43,0 @@ // type: 'unacquired';

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc