@onekeyfe/hd-core 0.2.7 → 0.2.9
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/BaseMethod.d.ts.map +1 -1
- package/dist/api/cardano/CardanoGetAddress.d.ts +8 -0
- package/dist/api/cardano/CardanoGetAddress.d.ts.map +1 -0
- package/dist/api/cardano/CardanoGetPublicKey.d.ts +8 -0
- package/dist/api/cardano/CardanoGetPublicKey.d.ts.map +1 -0
- package/dist/api/cardano/CardanoSignTransaction.d.ts +9 -0
- package/dist/api/cardano/CardanoSignTransaction.d.ts.map +1 -0
- package/dist/api/cardano/helper/addressParameters.d.ts +7 -0
- package/dist/api/cardano/helper/addressParameters.d.ts.map +1 -0
- package/dist/api/cardano/helper/auxiliaryData.d.ts +5 -0
- package/dist/api/cardano/helper/auxiliaryData.d.ts.map +1 -0
- package/dist/api/cardano/helper/cardanoInputs.d.ts +14 -0
- package/dist/api/cardano/helper/cardanoInputs.d.ts.map +1 -0
- package/dist/api/cardano/helper/cardanoOutputs.d.ts +11 -0
- package/dist/api/cardano/helper/cardanoOutputs.d.ts.map +1 -0
- package/dist/api/cardano/helper/certificate.d.ts +9 -0
- package/dist/api/cardano/helper/certificate.d.ts.map +1 -0
- package/dist/api/cardano/helper/token.d.ts +3 -0
- package/dist/api/cardano/helper/token.d.ts.map +1 -0
- package/dist/api/cardano/helper/utils.d.ts +3 -0
- package/dist/api/cardano/helper/utils.d.ts.map +1 -0
- package/dist/api/cardano/helper/witnesses.d.ts +5 -0
- package/dist/api/cardano/helper/witnesses.d.ts.map +1 -0
- package/dist/api/firmware/uploadFirmware.d.ts.map +1 -1
- package/dist/api/helpers/paramsValidator.d.ts +2 -1
- package/dist/api/helpers/paramsValidator.d.ts.map +1 -1
- package/dist/api/index.d.ts +6 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/sui/SuiGetAddress.d.ts +18 -0
- package/dist/api/sui/SuiGetAddress.d.ts.map +1 -0
- package/dist/api/sui/SuiGetPublicKey.d.ts +21 -0
- package/dist/api/sui/SuiGetPublicKey.d.ts.map +1 -0
- package/dist/api/sui/SuiSignTransaction.d.ts +15 -0
- package/dist/api/sui/SuiSignTransaction.d.ts.map +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/device/Device.d.ts +1 -0
- package/dist/device/Device.d.ts.map +1 -1
- package/dist/index.d.ts +233 -3
- package/dist/index.js +1203 -97
- package/dist/inject.d.ts.map +1 -1
- package/dist/types/api/cardano.d.ts +158 -0
- package/dist/types/api/cardano.d.ts.map +1 -0
- package/dist/types/api/cardanoGetAddress.d.ts +33 -0
- package/dist/types/api/cardanoGetAddress.d.ts.map +1 -0
- package/dist/types/api/cardanoGetPublicKey.d.ts +23 -0
- package/dist/types/api/cardanoGetPublicKey.d.ts.map +1 -0
- package/dist/types/api/cardanoSignTransaction.d.ts +4 -0
- package/dist/types/api/cardanoSignTransaction.d.ts.map +1 -0
- package/dist/types/api/export.d.ts +3 -0
- package/dist/types/api/export.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +12 -0
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/suiGetAddress.d.ts +15 -0
- package/dist/types/api/suiGetAddress.d.ts.map +1 -0
- package/dist/types/api/suiGetPublicKey.d.ts +14 -0
- package/dist/types/api/suiGetPublicKey.d.ts.map +1 -0
- package/dist/types/api/suiSignTransaction.d.ts +11 -0
- package/dist/types/api/suiSignTransaction.d.ts.map +1 -0
- 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/BaseMethod.ts +7 -1
- package/src/api/btc/helpers/signtxLegacy.ts +1 -1
- package/src/api/cardano/CardanoGetAddress.ts +87 -0
- package/src/api/cardano/CardanoGetPublicKey.ts +55 -0
- package/src/api/cardano/CardanoSignTransaction.ts +309 -0
- package/src/api/cardano/helper/addressParameters.ts +118 -0
- package/src/api/cardano/helper/auxiliaryData.ts +74 -0
- package/src/api/cardano/helper/cardanoInputs.ts +56 -0
- package/src/api/cardano/helper/cardanoOutputs.ts +89 -0
- package/src/api/cardano/helper/certificate.ts +199 -0
- package/src/api/cardano/helper/token.ts +43 -0
- package/src/api/cardano/helper/utils.ts +17 -0
- package/src/api/cardano/helper/witnesses.ts +63 -0
- package/src/api/firmware/uploadFirmware.ts +1 -3
- package/src/api/helpers/paramsValidator.ts +19 -1
- package/src/api/index.ts +8 -0
- package/src/api/sui/SuiGetAddress.ts +97 -0
- package/src/api/sui/SuiGetPublicKey.ts +63 -0
- package/src/api/sui/SuiSignTransaction.ts +48 -0
- package/src/core/index.ts +1 -0
- package/src/data/messages/messages.json +217 -69
- package/src/device/Device.ts +5 -0
- package/src/inject.ts +14 -0
- package/src/types/api/cardano.ts +186 -0
- package/src/types/api/cardanoGetAddress.ts +47 -0
- package/src/types/api/cardanoGetPublicKey.ts +33 -0
- package/src/types/api/cardanoSignTransaction.ts +8 -0
- package/src/types/api/export.ts +4 -0
- package/src/types/api/index.ts +22 -0
- package/src/types/api/suiGetAddress.ts +24 -0
- package/src/types/api/suiGetPublicKey.ts +23 -0
- package/src/types/api/suiSignTransaction.ts +17 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { CardanoAddressParametersType } from '@onekeyfe/hd-transport';
|
|
2
|
+
import type { CommonParams, Response } from '../params';
|
|
3
|
+
import type { CardanoAddressParameters } from './cardano';
|
|
4
|
+
|
|
5
|
+
export type CardanoGetAddressMethodParams = {
|
|
6
|
+
addressParameters: CardanoAddressParameters;
|
|
7
|
+
networkId: number;
|
|
8
|
+
/**
|
|
9
|
+
* Testnet cip34:0-1097911063
|
|
10
|
+
* Mainnet cip34:1-764824073
|
|
11
|
+
*/
|
|
12
|
+
protocolMagic: number;
|
|
13
|
+
derivationType: number;
|
|
14
|
+
address: string;
|
|
15
|
+
showOnOneKey: boolean;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type CardanoGetAddressParams = {
|
|
19
|
+
address_parameters: CardanoAddressParametersType;
|
|
20
|
+
network_id: number;
|
|
21
|
+
protocol_magic: number;
|
|
22
|
+
derivation_type: number;
|
|
23
|
+
address: string;
|
|
24
|
+
show_display: boolean;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type CardanoAddress = {
|
|
28
|
+
addressParameters: CardanoAddressParameters;
|
|
29
|
+
protocolMagic: number;
|
|
30
|
+
networkId: number;
|
|
31
|
+
serializedPath: string;
|
|
32
|
+
serializedStakingPath: string;
|
|
33
|
+
address: string;
|
|
34
|
+
xpub: string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export declare function cardanoGetAddress(
|
|
38
|
+
connectId: string,
|
|
39
|
+
deviceId: string,
|
|
40
|
+
params: CommonParams & CardanoGetAddressMethodParams
|
|
41
|
+
): Response<CardanoAddress>;
|
|
42
|
+
|
|
43
|
+
export declare function cardanoGetAddress(
|
|
44
|
+
connectId: string,
|
|
45
|
+
deviceId: string,
|
|
46
|
+
params: CommonParams & { bundle?: CardanoGetAddressMethodParams[] }
|
|
47
|
+
): Response<CardanoAddress[]>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { CommonParams, Response } from '../params';
|
|
2
|
+
import { PROTO } from '../../constants';
|
|
3
|
+
|
|
4
|
+
export type CardanoPublicKey = {
|
|
5
|
+
path: number[];
|
|
6
|
+
serializedPath: string;
|
|
7
|
+
publicKey: string;
|
|
8
|
+
node: PROTO.HDNodeType;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type CardanoPublicKeyParams = {
|
|
12
|
+
address_n: number[];
|
|
13
|
+
derivation_type: number;
|
|
14
|
+
show_display: boolean;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type CardanoPublicKeyMethodParams = {
|
|
18
|
+
path: string | number[];
|
|
19
|
+
derivationType?: number;
|
|
20
|
+
showOnOneKey?: boolean;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export declare function cardanoGetPublicKey(
|
|
24
|
+
connectId: string,
|
|
25
|
+
deviceId: string,
|
|
26
|
+
params: CommonParams & CardanoPublicKeyMethodParams
|
|
27
|
+
): Response<CardanoPublicKey>;
|
|
28
|
+
|
|
29
|
+
export declare function cardanoGetPublicKey(
|
|
30
|
+
connectId: string,
|
|
31
|
+
deviceId: string,
|
|
32
|
+
params: CommonParams & { bundle?: CardanoPublicKeyMethodParams[] }
|
|
33
|
+
): Response<CardanoPublicKey[]>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CommonParams, Response } from '../params';
|
|
2
|
+
import type { CardanoSignTransaction, CardanoSignedTxData } from './cardano';
|
|
3
|
+
|
|
4
|
+
export declare function cardanoSignTransaction(
|
|
5
|
+
connectId: string,
|
|
6
|
+
deviceId: string,
|
|
7
|
+
params: CommonParams & CardanoSignTransaction
|
|
8
|
+
): Response<CardanoSignedTxData>;
|
package/src/types/api/export.ts
CHANGED
|
@@ -106,3 +106,7 @@ export type { AlgoSignedTx, AlgoSignTransactionParams } from './algoSignTransact
|
|
|
106
106
|
export type { CosmosAddress, CosmosGetAddressParams } from './cosmosGetAddress';
|
|
107
107
|
export type { CosmosPublicKey, CosmosGetPublicKeyParams } from './cosmosGetPublicKey';
|
|
108
108
|
export type { CosmosSignedTx, CosmosSignTransactionParams } from './cosmosSignTransaction';
|
|
109
|
+
|
|
110
|
+
export type { SuiAddress, SuiGetAddressParams } from './suiGetAddress';
|
|
111
|
+
export type { SuiPublicKey, SuiGetPublicKeyParams } from './suiGetPublicKey';
|
|
112
|
+
export type { SuiSignedTx, SuiSignTransactionParams } from './suiSignTransaction';
|
package/src/types/api/index.ts
CHANGED
|
@@ -86,6 +86,14 @@ import { cosmosSignTransaction } from './cosmosSignTransaction';
|
|
|
86
86
|
import { xrpGetAddress } from './xrpGetAddress';
|
|
87
87
|
import { xrpSignTransaction } from './xrpSignTransaction';
|
|
88
88
|
|
|
89
|
+
import { suiGetAddress } from './suiGetAddress';
|
|
90
|
+
import { suiGetPublicKey } from './suiGetPublicKey';
|
|
91
|
+
import { suiSignTransaction } from './suiSignTransaction';
|
|
92
|
+
|
|
93
|
+
import { cardanoGetAddress } from './cardanoGetAddress';
|
|
94
|
+
import { cardanoGetPublicKey } from './cardanoGetPublicKey';
|
|
95
|
+
import { cardanoSignTransaction } from './cardanoSignTransaction';
|
|
96
|
+
|
|
89
97
|
export * from './export';
|
|
90
98
|
|
|
91
99
|
export type CoreApi = {
|
|
@@ -229,4 +237,18 @@ export type CoreApi = {
|
|
|
229
237
|
*/
|
|
230
238
|
xrpGetAddress: typeof xrpGetAddress;
|
|
231
239
|
xrpSignTransaction: typeof xrpSignTransaction;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* SUI function
|
|
243
|
+
*/
|
|
244
|
+
suiGetAddress: typeof suiGetAddress;
|
|
245
|
+
suiGetPublicKey: typeof suiGetPublicKey;
|
|
246
|
+
suiSignTransaction: typeof suiSignTransaction;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Cardano function
|
|
250
|
+
*/
|
|
251
|
+
cardanoGetAddress: typeof cardanoGetAddress;
|
|
252
|
+
cardanoGetPublicKey: typeof cardanoGetPublicKey;
|
|
253
|
+
cardanoSignTransaction: typeof cardanoSignTransaction;
|
|
232
254
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SuiAddress as HardwareSuiAddress } from '@onekeyfe/hd-transport';
|
|
2
|
+
import type { CommonParams, Response } from '../params';
|
|
3
|
+
|
|
4
|
+
export type SuiAddress = {
|
|
5
|
+
path: string;
|
|
6
|
+
publicKey?: string;
|
|
7
|
+
} & HardwareSuiAddress;
|
|
8
|
+
|
|
9
|
+
export type SuiGetAddressParams = {
|
|
10
|
+
path: string | number[];
|
|
11
|
+
showOnOneKey?: boolean;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export declare function suiGetAddress(
|
|
15
|
+
connectId: string,
|
|
16
|
+
deviceId: string,
|
|
17
|
+
params: CommonParams & HardwareSuiAddress
|
|
18
|
+
): Response<SuiAddress>;
|
|
19
|
+
|
|
20
|
+
export declare function suiGetAddress(
|
|
21
|
+
connectId: string,
|
|
22
|
+
deviceId: string,
|
|
23
|
+
params: CommonParams & { bundle?: HardwareSuiAddress[] }
|
|
24
|
+
): Response<Array<SuiAddress>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CommonParams, Response } from '../params';
|
|
2
|
+
|
|
3
|
+
export type SuiPublicKey = {
|
|
4
|
+
path: string;
|
|
5
|
+
publicKey: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export type SuiGetPublicKeyParams = {
|
|
9
|
+
path: string | number[];
|
|
10
|
+
showOnOneKey?: boolean;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export declare function suiGetPublicKey(
|
|
14
|
+
connectId: string,
|
|
15
|
+
deviceId: string,
|
|
16
|
+
params: CommonParams & SuiGetPublicKeyParams
|
|
17
|
+
): Response<SuiPublicKey>;
|
|
18
|
+
|
|
19
|
+
export declare function suiGetPublicKey(
|
|
20
|
+
connectId: string,
|
|
21
|
+
deviceId: string,
|
|
22
|
+
params: CommonParams & { bundle?: SuiGetPublicKeyParams[] }
|
|
23
|
+
): Response<Array<SuiPublicKey>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AptosSignedTx as HardwareAptosSignedTx } from '@onekeyfe/hd-transport';
|
|
2
|
+
import type { CommonParams, Response } from '../params';
|
|
3
|
+
|
|
4
|
+
export type SuiSignedTx = {
|
|
5
|
+
path: string;
|
|
6
|
+
} & HardwareAptosSignedTx;
|
|
7
|
+
|
|
8
|
+
export type SuiSignTransactionParams = {
|
|
9
|
+
path: string | number[];
|
|
10
|
+
rawTx?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export declare function suiSignTransaction(
|
|
14
|
+
connectId: string,
|
|
15
|
+
deviceId: string,
|
|
16
|
+
params: CommonParams & SuiSignTransactionParams
|
|
17
|
+
): Response<SuiSignedTx>;
|