@onekeyfe/hd-core 0.2.7 → 0.2.8
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/index.d.ts +3 -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/index.d.ts +41 -3
- package/dist/index.js +276 -2
- package/dist/inject.d.ts.map +1 -1
- 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 +6 -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/index.ts +4 -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/data/messages/messages.json +110 -1
- package/src/inject.ts +7 -0
- package/src/types/api/export.ts +4 -0
- package/src/types/api/index.ts +11 -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
|
@@ -5591,6 +5591,52 @@
|
|
|
5591
5591
|
"RebootToBootloader": {
|
|
5592
5592
|
"fields": {}
|
|
5593
5593
|
},
|
|
5594
|
+
"RebootToBoardloader": {
|
|
5595
|
+
"fields": {}
|
|
5596
|
+
},
|
|
5597
|
+
"ListResDir": {
|
|
5598
|
+
"fields": {
|
|
5599
|
+
"path": {
|
|
5600
|
+
"rule": "required",
|
|
5601
|
+
"type": "string",
|
|
5602
|
+
"id": 1
|
|
5603
|
+
}
|
|
5604
|
+
}
|
|
5605
|
+
},
|
|
5606
|
+
"FileInfoList": {
|
|
5607
|
+
"fields": {
|
|
5608
|
+
"files": {
|
|
5609
|
+
"rule": "repeated",
|
|
5610
|
+
"type": "FileInfo",
|
|
5611
|
+
"id": 1
|
|
5612
|
+
}
|
|
5613
|
+
},
|
|
5614
|
+
"nested": {
|
|
5615
|
+
"FileInfo": {
|
|
5616
|
+
"fields": {
|
|
5617
|
+
"name": {
|
|
5618
|
+
"rule": "required",
|
|
5619
|
+
"type": "string",
|
|
5620
|
+
"id": 1
|
|
5621
|
+
},
|
|
5622
|
+
"size": {
|
|
5623
|
+
"rule": "required",
|
|
5624
|
+
"type": "uint64",
|
|
5625
|
+
"id": 2
|
|
5626
|
+
}
|
|
5627
|
+
}
|
|
5628
|
+
}
|
|
5629
|
+
}
|
|
5630
|
+
},
|
|
5631
|
+
"DeviceEraseSector": {
|
|
5632
|
+
"fields": {
|
|
5633
|
+
"sector": {
|
|
5634
|
+
"rule": "required",
|
|
5635
|
+
"type": "uint32",
|
|
5636
|
+
"id": 1
|
|
5637
|
+
}
|
|
5638
|
+
}
|
|
5639
|
+
},
|
|
5594
5640
|
"MoneroTransactionSourceEntry": {
|
|
5595
5641
|
"fields": {
|
|
5596
5642
|
"outputs": {
|
|
@@ -7724,6 +7770,61 @@
|
|
|
7724
7770
|
}
|
|
7725
7771
|
}
|
|
7726
7772
|
},
|
|
7773
|
+
"SuiGetAddress": {
|
|
7774
|
+
"fields": {
|
|
7775
|
+
"address_n": {
|
|
7776
|
+
"rule": "repeated",
|
|
7777
|
+
"type": "uint32",
|
|
7778
|
+
"id": 1,
|
|
7779
|
+
"options": {
|
|
7780
|
+
"packed": false
|
|
7781
|
+
}
|
|
7782
|
+
},
|
|
7783
|
+
"show_display": {
|
|
7784
|
+
"type": "bool",
|
|
7785
|
+
"id": 2
|
|
7786
|
+
}
|
|
7787
|
+
}
|
|
7788
|
+
},
|
|
7789
|
+
"SuiAddress": {
|
|
7790
|
+
"fields": {
|
|
7791
|
+
"address": {
|
|
7792
|
+
"type": "string",
|
|
7793
|
+
"id": 1
|
|
7794
|
+
}
|
|
7795
|
+
}
|
|
7796
|
+
},
|
|
7797
|
+
"SuiSignTx": {
|
|
7798
|
+
"fields": {
|
|
7799
|
+
"address_n": {
|
|
7800
|
+
"rule": "repeated",
|
|
7801
|
+
"type": "uint32",
|
|
7802
|
+
"id": 1,
|
|
7803
|
+
"options": {
|
|
7804
|
+
"packed": false
|
|
7805
|
+
}
|
|
7806
|
+
},
|
|
7807
|
+
"raw_tx": {
|
|
7808
|
+
"rule": "required",
|
|
7809
|
+
"type": "bytes",
|
|
7810
|
+
"id": 2
|
|
7811
|
+
}
|
|
7812
|
+
}
|
|
7813
|
+
},
|
|
7814
|
+
"SuiSignedTx": {
|
|
7815
|
+
"fields": {
|
|
7816
|
+
"public_key": {
|
|
7817
|
+
"rule": "required",
|
|
7818
|
+
"type": "bytes",
|
|
7819
|
+
"id": 1
|
|
7820
|
+
},
|
|
7821
|
+
"signature": {
|
|
7822
|
+
"rule": "required",
|
|
7823
|
+
"type": "bytes",
|
|
7824
|
+
"id": 2
|
|
7825
|
+
}
|
|
7826
|
+
}
|
|
7827
|
+
},
|
|
7727
7828
|
"TezosGetAddress": {
|
|
7728
7829
|
"fields": {
|
|
7729
7830
|
"address_n": {
|
|
@@ -8721,6 +8822,10 @@
|
|
|
8721
8822
|
"MessageType_AlgorandAddress": 10901,
|
|
8722
8823
|
"MessageType_AlgorandSignTx": 10902,
|
|
8723
8824
|
"MessageType_AlgorandSignedTx": 10903,
|
|
8825
|
+
"MessageType_SuiGetAddress": 11100,
|
|
8826
|
+
"MessageType_SuiAddress": 11101,
|
|
8827
|
+
"MessageType_SuiSignTx": 11102,
|
|
8828
|
+
"MessageType_SuiSignedTx": 11103,
|
|
8724
8829
|
"MessageType_DeviceBackToBoot": 903,
|
|
8725
8830
|
"MessageType_DeviceInfoSettings": 10001,
|
|
8726
8831
|
"MessageType_GetDeviceInfo": 10002,
|
|
@@ -8741,7 +8846,11 @@
|
|
|
8741
8846
|
"MessageType_ZoomRequest": 10019,
|
|
8742
8847
|
"MessageType_ResourceRequest": 10020,
|
|
8743
8848
|
"MessageType_ResourceAck": 10021,
|
|
8744
|
-
"MessageType_ResourceUpdate": 10022
|
|
8849
|
+
"MessageType_ResourceUpdate": 10022,
|
|
8850
|
+
"MessageType_ListResDir": 10023,
|
|
8851
|
+
"MessageType_FileInfoList": 10024,
|
|
8852
|
+
"MessageType_RebootToBoardloader": 10025,
|
|
8853
|
+
"MessageType_DeviceEraseSector": 10026
|
|
8745
8854
|
}
|
|
8746
8855
|
},
|
|
8747
8856
|
"google": {
|
package/src/inject.ts
CHANGED
|
@@ -198,6 +198,13 @@ export const inject = ({
|
|
|
198
198
|
call({ ...params, connectId, deviceId, method: 'xrpGetAddress' }),
|
|
199
199
|
xrpSignTransaction: (connectId, deviceId, params) =>
|
|
200
200
|
call({ ...params, connectId, deviceId, method: 'xrpSignTransaction' }),
|
|
201
|
+
|
|
202
|
+
suiGetAddress: (connectId, deviceId, params) =>
|
|
203
|
+
call({ ...params, connectId, deviceId, method: 'suiGetAddress' }),
|
|
204
|
+
suiGetPublicKey: (connectId, deviceId, params) =>
|
|
205
|
+
call({ ...params, connectId, deviceId, method: 'suiGetPublicKey' }),
|
|
206
|
+
suiSignTransaction: (connectId, deviceId, params) =>
|
|
207
|
+
call({ ...params, connectId, deviceId, method: 'suiSignTransaction' }),
|
|
201
208
|
};
|
|
202
209
|
return api;
|
|
203
210
|
};
|
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,10 @@ 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
|
+
|
|
89
93
|
export * from './export';
|
|
90
94
|
|
|
91
95
|
export type CoreApi = {
|
|
@@ -229,4 +233,11 @@ export type CoreApi = {
|
|
|
229
233
|
*/
|
|
230
234
|
xrpGetAddress: typeof xrpGetAddress;
|
|
231
235
|
xrpSignTransaction: typeof xrpSignTransaction;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* SUI function
|
|
239
|
+
*/
|
|
240
|
+
suiGetAddress: typeof suiGetAddress;
|
|
241
|
+
suiGetPublicKey: typeof suiGetPublicKey;
|
|
242
|
+
suiSignTransaction: typeof suiSignTransaction;
|
|
232
243
|
};
|
|
@@ -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>;
|