@onekeyfe/hd-core 0.2.10 → 0.2.12
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/api/cardano/CardanoGetAddress.d.ts +5 -0
- package/dist/api/cardano/CardanoGetAddress.d.ts.map +1 -1
- package/dist/api/cardano/CardanoGetPublicKey.d.ts +5 -0
- package/dist/api/cardano/CardanoGetPublicKey.d.ts.map +1 -1
- package/dist/api/cardano/CardanoSignMessage.d.ts +14 -0
- package/dist/api/cardano/CardanoSignMessage.d.ts.map +1 -0
- package/dist/api/cardano/CardanoSignTransaction.d.ts +5 -0
- package/dist/api/cardano/CardanoSignTransaction.d.ts.map +1 -1
- package/dist/api/cardano/helper/auxiliaryData.d.ts.map +1 -1
- package/dist/api/cardano/helper/cardanoInputs.d.ts.map +1 -1
- package/dist/api/cardano/helper/cardanoOutputs.d.ts.map +1 -1
- package/dist/api/cardano/helper/certificate.d.ts.map +1 -1
- package/dist/api/cardano/helper/witnesses.d.ts.map +1 -1
- package/dist/api/device/DeviceUploadResource.d.ts.map +1 -1
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/index.d.ts +13 -3
- package/dist/index.js +242 -268
- package/dist/inject.d.ts.map +1 -1
- package/dist/types/api/cardano.d.ts.map +1 -1
- package/dist/types/api/cardanoSignMessage.d.ts +16 -0
- package/dist/types/api/cardanoSignMessage.d.ts.map +1 -0
- package/dist/types/api/index.d.ts +2 -0
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/patch.d.ts +1 -1
- package/dist/utils/patch.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/cardano/CardanoGetAddress.ts +9 -1
- package/src/api/cardano/CardanoGetPublicKey.ts +9 -1
- package/src/api/cardano/CardanoSignMessage.ts +58 -0
- package/src/api/cardano/CardanoSignTransaction.ts +10 -7
- package/src/api/cardano/helper/auxiliaryData.ts +4 -0
- package/src/api/cardano/helper/cardanoInputs.ts +0 -2
- package/src/api/cardano/helper/cardanoOutputs.ts +0 -1
- package/src/api/cardano/helper/certificate.ts +0 -2
- package/src/api/cardano/helper/witnesses.ts +0 -2
- package/src/api/device/DeviceUploadResource.ts +3 -1
- package/src/api/index.ts +1 -0
- package/src/data/messages/messages.json +281 -368
- package/src/inject.ts +2 -0
- package/src/types/api/cardano.ts +0 -1
- package/src/types/api/cardanoSignMessage.ts +22 -0
- package/src/types/api/index.ts +2 -0
- package/src/utils/index.ts +1 -1
package/src/inject.ts
CHANGED
|
@@ -212,6 +212,8 @@ export const inject = ({
|
|
|
212
212
|
call({ ...params, connectId, deviceId, method: 'cardanoGetPublicKey' }),
|
|
213
213
|
cardanoSignTransaction: (connectId, deviceId, params) =>
|
|
214
214
|
call({ ...params, connectId, deviceId, method: 'cardanoSignTransaction' }),
|
|
215
|
+
cardanoSignMessage: (connectId, deviceId, params) =>
|
|
216
|
+
call({ ...params, connectId, deviceId, method: 'cardanoSignMessage' }),
|
|
215
217
|
};
|
|
216
218
|
return api;
|
|
217
219
|
};
|
package/src/types/api/cardano.ts
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CardanoMessageSignature } from '@onekeyfe/hd-transport';
|
|
2
|
+
import type { CommonParams, Response } from '../params';
|
|
3
|
+
|
|
4
|
+
export type CardanoSignMessageParams = {
|
|
5
|
+
address_n: number[];
|
|
6
|
+
message: string;
|
|
7
|
+
derivation_type: number;
|
|
8
|
+
network_id: number;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type CardanoSignMessageMethodParams = {
|
|
12
|
+
path: string;
|
|
13
|
+
message: string;
|
|
14
|
+
derivationType: number;
|
|
15
|
+
networkId: number;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export declare function cardanoSignMessage(
|
|
19
|
+
connectId: string,
|
|
20
|
+
deviceId: string,
|
|
21
|
+
params: CommonParams & CardanoSignMessageMethodParams
|
|
22
|
+
): Response<CardanoMessageSignature>;
|
package/src/types/api/index.ts
CHANGED
|
@@ -93,6 +93,7 @@ import { suiSignTransaction } from './suiSignTransaction';
|
|
|
93
93
|
import { cardanoGetAddress } from './cardanoGetAddress';
|
|
94
94
|
import { cardanoGetPublicKey } from './cardanoGetPublicKey';
|
|
95
95
|
import { cardanoSignTransaction } from './cardanoSignTransaction';
|
|
96
|
+
import { cardanoSignMessage } from './cardanoSignMessage';
|
|
96
97
|
|
|
97
98
|
export * from './export';
|
|
98
99
|
|
|
@@ -251,4 +252,5 @@ export type CoreApi = {
|
|
|
251
252
|
cardanoGetAddress: typeof cardanoGetAddress;
|
|
252
253
|
cardanoGetPublicKey: typeof cardanoGetPublicKey;
|
|
253
254
|
cardanoSignTransaction: typeof cardanoSignTransaction;
|
|
255
|
+
cardanoSignMessage: typeof cardanoSignMessage;
|
|
254
256
|
};
|
package/src/utils/index.ts
CHANGED
|
@@ -8,7 +8,7 @@ export {
|
|
|
8
8
|
getDeviceUUID,
|
|
9
9
|
getDeviceLabel,
|
|
10
10
|
} from './deviceFeaturesUtils';
|
|
11
|
-
export { getHDPath, getScriptType } from '../api/helpers/pathUtils';
|
|
11
|
+
export { getHDPath, getScriptType, getOutputScriptType } from '../api/helpers/pathUtils';
|
|
12
12
|
|
|
13
13
|
export { getLogger, enableLog, LoggerNames, getLog, setLoggerPostMessage } from './logger';
|
|
14
14
|
|