@onekeyfe/hd-core 0.0.2 → 0.0.5
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/{BTCGetAddress.d.ts → btc/BTCGetAddress.d.ts} +2 -2
- package/dist/api/btc/BTCGetAddress.d.ts.map +1 -0
- package/dist/api/{BTCGetPublicKey.d.ts → btc/BTCGetPublicKey.d.ts} +2 -2
- package/dist/api/btc/BTCGetPublicKey.d.ts.map +1 -0
- package/dist/api/{BTCSignMessage.d.ts → btc/BTCSignMessage.d.ts} +1 -1
- package/dist/api/btc/BTCSignMessage.d.ts.map +1 -0
- package/dist/api/{BTCSignTransaction.d.ts → btc/BTCSignTransaction.d.ts} +3 -3
- package/dist/api/btc/BTCSignTransaction.d.ts.map +1 -0
- package/dist/api/{BTCVerifyMessage.d.ts → btc/BTCVerifyMessage.d.ts} +1 -1
- package/dist/api/btc/BTCVerifyMessage.d.ts.map +1 -0
- package/dist/api/{helpers → btc/helpers}/btcParamsUtils.d.ts +0 -0
- package/dist/api/btc/helpers/btcParamsUtils.d.ts.map +1 -0
- package/dist/api/{helpers/btc → btc/helpers}/signtx.d.ts +0 -0
- package/dist/api/{helpers/btc → btc/helpers}/signtx.d.ts.map +1 -1
- package/dist/api/{helpers/btc → btc/helpers}/signtxLegacy.d.ts +0 -0
- package/dist/api/{helpers/btc → btc/helpers}/signtxLegacy.d.ts.map +1 -1
- package/dist/api/{DeviceBackup.d.ts → device/DeviceBackup.d.ts} +1 -1
- package/dist/api/device/DeviceBackup.d.ts.map +1 -0
- package/dist/api/{DeviceChangePin.d.ts → device/DeviceChangePin.d.ts} +1 -1
- package/dist/api/device/DeviceChangePin.d.ts.map +1 -0
- package/dist/api/{DeviceFlags.d.ts → device/DeviceFlags.d.ts} +1 -1
- package/dist/api/device/DeviceFlags.d.ts.map +1 -0
- package/dist/api/{DeviceRebootToBootloader.d.ts → device/DeviceRebootToBootloader.d.ts} +1 -1
- package/dist/api/device/DeviceRebootToBootloader.d.ts.map +1 -0
- package/dist/api/{DeviceRecovery.d.ts → device/DeviceRecovery.d.ts} +1 -1
- package/dist/api/device/DeviceRecovery.d.ts.map +1 -0
- package/dist/api/{DeviceReset.d.ts → device/DeviceReset.d.ts} +1 -1
- package/dist/api/device/DeviceReset.d.ts.map +1 -0
- package/dist/api/{DeviceSettings.d.ts → device/DeviceSettings.d.ts} +1 -1
- package/dist/api/device/DeviceSettings.d.ts.map +1 -0
- package/dist/api/{DeviceUpdateReboot.d.ts → device/DeviceUpdateReboot.d.ts} +1 -1
- package/dist/api/device/DeviceUpdateReboot.d.ts.map +1 -0
- package/dist/api/{DeviceWipe.d.ts → device/DeviceWipe.d.ts} +1 -1
- package/dist/api/device/DeviceWipe.d.ts.map +1 -0
- package/dist/api/{EVMGetAddress.d.ts → evm/EVMGetAddress.d.ts} +2 -2
- package/dist/api/evm/EVMGetAddress.d.ts.map +1 -0
- package/dist/api/{EVMGetPublicKey.d.ts → evm/EVMGetPublicKey.d.ts} +2 -2
- package/dist/api/evm/EVMGetPublicKey.d.ts.map +1 -0
- package/dist/api/{EVMSignMessage.d.ts → evm/EVMSignMessage.d.ts} +1 -1
- package/dist/api/evm/EVMSignMessage.d.ts.map +1 -0
- package/dist/api/{EVMSignMessageEIP712.d.ts → evm/EVMSignMessageEIP712.d.ts} +1 -1
- package/dist/api/evm/EVMSignMessageEIP712.d.ts.map +1 -0
- package/dist/api/{EVMSignTransaction.d.ts → evm/EVMSignTransaction.d.ts} +2 -2
- package/dist/api/evm/EVMSignTransaction.d.ts.map +1 -0
- package/dist/api/{EVMSignTypedData.d.ts → evm/EVMSignTypedData.d.ts} +3 -3
- package/dist/api/evm/EVMSignTypedData.d.ts.map +1 -0
- package/dist/api/{EVMVerifyMessage.d.ts → evm/EVMVerifyMessage.d.ts} +1 -1
- package/dist/api/evm/EVMVerifyMessage.d.ts.map +1 -0
- package/dist/api/helpers/pathUtils.d.ts +0 -1
- package/dist/api/helpers/pathUtils.d.ts.map +1 -1
- package/dist/api/index.d.ts +26 -21
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/starcoin/StarcoinGetAddress.d.ts +9 -0
- package/dist/api/starcoin/StarcoinGetAddress.d.ts.map +1 -0
- package/dist/api/starcoin/StarcoinGetPublicKey.d.ts +9 -0
- package/dist/api/starcoin/StarcoinGetPublicKey.d.ts.map +1 -0
- package/dist/api/starcoin/StarcoinSignMessage.d.ts +10 -0
- package/dist/api/starcoin/StarcoinSignMessage.d.ts.map +1 -0
- package/dist/api/starcoin/StarcoinSignTransaction.d.ts +10 -0
- package/dist/api/starcoin/StarcoinSignTransaction.d.ts.map +1 -0
- package/dist/api/starcoin/StarcoinVerifyMessage.d.ts +9 -0
- package/dist/api/starcoin/StarcoinVerifyMessage.d.ts.map +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/events/core.d.ts +2 -1
- package/dist/events/core.d.ts.map +1 -1
- package/dist/events/device.d.ts +15 -0
- package/dist/events/device.d.ts.map +1 -1
- package/dist/events/ui-request.d.ts +13 -1
- package/dist/events/ui-request.d.ts.map +1 -1
- package/dist/index.d.ts +167 -28
- package/dist/index.js +335 -148
- package/dist/inject.d.ts.map +1 -1
- package/dist/types/api/btcSignTransaction.d.ts +2 -2
- package/dist/types/api/btcSignTransaction.d.ts.map +1 -1
- package/dist/types/api/export.d.ts +23 -0
- package/dist/types/api/export.d.ts.map +1 -0
- package/dist/types/api/index.d.ts +11 -0
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/init.d.ts +1 -1
- package/dist/types/api/init.d.ts.map +1 -1
- package/dist/types/api/starcoinGetAddress.d.ts +14 -0
- package/dist/types/api/starcoinGetAddress.d.ts.map +1 -0
- package/dist/types/api/starcoinGetPublicKey.d.ts +14 -0
- package/dist/types/api/starcoinGetPublicKey.d.ts.map +1 -0
- package/dist/types/api/starcoinSignMessage.d.ts +8 -0
- package/dist/types/api/starcoinSignMessage.d.ts.map +1 -0
- package/dist/types/api/starcoinSignTransaction.d.ts +8 -0
- package/dist/types/api/starcoinSignTransaction.d.ts.map +1 -0
- package/dist/types/api/starcoinVerifyMessage.d.ts +9 -0
- package/dist/types/api/starcoinVerifyMessage.d.ts.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/api/{BTCGetAddress.ts → btc/BTCGetAddress.ts} +5 -5
- package/src/api/{BTCGetPublicKey.ts → btc/BTCGetPublicKey.ts} +8 -8
- package/src/api/{BTCSignMessage.ts → btc/BTCSignMessage.ts} +5 -5
- package/src/api/{BTCSignTransaction.ts → btc/BTCSignTransaction.ts} +8 -8
- package/src/api/{BTCVerifyMessage.ts → btc/BTCVerifyMessage.ts} +4 -4
- package/src/api/{helpers → btc/helpers}/btcParamsUtils.ts +3 -3
- package/src/api/{helpers/btc → btc/helpers}/signtx.ts +0 -0
- package/src/api/{helpers/btc → btc/helpers}/signtxLegacy.ts +0 -0
- package/src/api/{DeviceBackup.ts → device/DeviceBackup.ts} +1 -1
- package/src/api/{DeviceChangePin.ts → device/DeviceChangePin.ts} +2 -2
- package/src/api/{DeviceFlags.ts → device/DeviceFlags.ts} +2 -2
- package/src/api/{DeviceRebootToBootloader.ts → device/DeviceRebootToBootloader.ts} +1 -1
- package/src/api/{DeviceRecovery.ts → device/DeviceRecovery.ts} +2 -2
- package/src/api/{DeviceReset.ts → device/DeviceReset.ts} +2 -2
- package/src/api/{DeviceSettings.ts → device/DeviceSettings.ts} +2 -2
- package/src/api/{DeviceUpdateReboot.ts → device/DeviceUpdateReboot.ts} +1 -1
- package/src/api/{DeviceWipe.ts → device/DeviceWipe.ts} +1 -1
- package/src/api/{EVMGetAddress.ts → evm/EVMGetAddress.ts} +5 -5
- package/src/api/{EVMGetPublicKey.ts → evm/EVMGetPublicKey.ts} +5 -5
- package/src/api/{EVMSignMessage.ts → evm/EVMSignMessage.ts} +5 -5
- package/src/api/{EVMSignMessageEIP712.ts → evm/EVMSignMessageEIP712.ts} +5 -5
- package/src/api/{EVMSignTransaction.ts → evm/EVMSignTransaction.ts} +9 -9
- package/src/api/{EVMSignTypedData.ts → evm/EVMSignTypedData.ts} +8 -8
- package/src/api/{EVMVerifyMessage.ts → evm/EVMVerifyMessage.ts} +4 -4
- package/src/api/helpers/pathUtils.ts +1 -1
- package/src/api/index.ts +26 -21
- package/src/api/starcoin/StarcoinGetAddress.ts +57 -0
- package/src/api/starcoin/StarcoinGetPublicKey.ts +64 -0
- package/src/api/starcoin/StarcoinSignMessage.ts +40 -0
- package/src/api/starcoin/StarcoinSignTransaction.ts +36 -0
- package/src/api/starcoin/StarcoinVerifyMessage.ts +33 -0
- package/src/core/index.ts +25 -0
- package/src/events/core.ts +8 -1
- package/src/events/device.ts +27 -0
- package/src/events/ui-request.ts +16 -1
- package/src/inject.ts +12 -1
- package/src/types/api/btcSignTransaction.ts +1 -2
- package/src/types/api/export.ts +43 -0
- package/src/types/api/index.ts +13 -0
- package/src/types/api/init.ts +1 -1
- package/src/types/api/starcoinGetAddress.ts +21 -0
- package/src/types/api/starcoinGetPublicKey.ts +21 -0
- package/src/types/api/starcoinSignMessage.ts +12 -0
- package/src/types/api/starcoinSignTransaction.ts +12 -0
- package/src/types/api/starcoinVerifyMessage.ts +13 -0
- package/src/utils/index.ts +2 -0
- package/dist/api/BTCGetAddress.d.ts.map +0 -1
- package/dist/api/BTCGetPublicKey.d.ts.map +0 -1
- package/dist/api/BTCSignMessage.d.ts.map +0 -1
- package/dist/api/BTCSignTransaction.d.ts.map +0 -1
- package/dist/api/BTCVerifyMessage.d.ts.map +0 -1
- package/dist/api/DeviceBackup.d.ts.map +0 -1
- package/dist/api/DeviceChangePin.d.ts.map +0 -1
- package/dist/api/DeviceFlags.d.ts.map +0 -1
- package/dist/api/DeviceRebootToBootloader.d.ts.map +0 -1
- package/dist/api/DeviceRecovery.d.ts.map +0 -1
- package/dist/api/DeviceReset.d.ts.map +0 -1
- package/dist/api/DeviceSettings.d.ts.map +0 -1
- package/dist/api/DeviceUpdateReboot.d.ts.map +0 -1
- package/dist/api/DeviceWipe.d.ts.map +0 -1
- package/dist/api/EVMGetAddress.d.ts.map +0 -1
- package/dist/api/EVMGetPublicKey.d.ts.map +0 -1
- package/dist/api/EVMSignMessage.d.ts.map +0 -1
- package/dist/api/EVMSignMessageEIP712.d.ts.map +0 -1
- package/dist/api/EVMSignTransaction.d.ts.map +0 -1
- package/dist/api/EVMSignTypedData.d.ts.map +0 -1
- package/dist/api/EVMVerifyMessage.d.ts.map +0 -1
- package/dist/api/helpers/btcParamsUtils.d.ts.map +0 -1
|
@@ -27,6 +27,12 @@ import { deviceChangePin } from './deviceChangePin';
|
|
|
27
27
|
import { deviceSettings } from './deviceSettings';
|
|
28
28
|
import { deviceFlags } from './deviceFlags';
|
|
29
29
|
import { deviceUpdateReboot } from './deviceUpdateReboot';
|
|
30
|
+
import { starcoinGetAddress } from './starcoinGetAddress';
|
|
31
|
+
import { starcoinGetPublicKey } from './starcoinGetPublicKey';
|
|
32
|
+
import { starcoinSignMessage } from './starcoinSignMessage';
|
|
33
|
+
import { starcoinSignTransaction } from './starcoinSignTransaction';
|
|
34
|
+
import { starcoinVerifyMessage } from './starcoinVerifyMessage';
|
|
35
|
+
export * from './export';
|
|
30
36
|
export declare type CoreApi = {
|
|
31
37
|
init: typeof init;
|
|
32
38
|
on: typeof on;
|
|
@@ -62,5 +68,10 @@ export declare type CoreApi = {
|
|
|
62
68
|
btcSignMessage: typeof btcSignMessage;
|
|
63
69
|
btcSignTransaction: typeof btcSignTransaction;
|
|
64
70
|
btcVerifyMessage: typeof btcVerifyMessage;
|
|
71
|
+
starcoinGetAddress: typeof starcoinGetAddress;
|
|
72
|
+
starcoinGetPublicKey: typeof starcoinGetPublicKey;
|
|
73
|
+
starcoinSignMessage: typeof starcoinSignMessage;
|
|
74
|
+
starcoinSignTransaction: typeof starcoinSignTransaction;
|
|
75
|
+
starcoinVerifyMessage: typeof starcoinVerifyMessage;
|
|
65
76
|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AAO,gBAAgB,CAAC;IAE1C,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;IAC9C,oBAAoB,EAAE,OAAO,oBAAoB,CAAC;IAClD,mBAAmB,EAAE,OAAO,mBAAmB,CAAC;IAChD,uBAAuB,EAAE,OAAO,uBAAuB,CAAC;IACxD,qBAAqB,EAAE,OAAO,qBAAqB,CAAC;CACrD,CAAC"}
|
package/dist/types/api/init.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/types/api/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/types/api/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StarcoinAddress as HardwareStarcoinAddress } from '@onekeyfe/hd-transport/src/types/messages';
|
|
2
|
+
import type { CommonParams, Response } from '../params';
|
|
3
|
+
export declare type StarcoinAddress = {
|
|
4
|
+
path: string;
|
|
5
|
+
} & HardwareStarcoinAddress;
|
|
6
|
+
export declare type StarcoinGetAddressParams = {
|
|
7
|
+
path: string | number[];
|
|
8
|
+
showOnOneKey?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare function starcoinGetAddress(connectId: string, params: CommonParams & StarcoinGetAddressParams): Response<StarcoinAddress>;
|
|
11
|
+
export declare function starcoinGetAddress(connectId: string, params: CommonParams & {
|
|
12
|
+
bundle?: StarcoinGetAddressParams[];
|
|
13
|
+
}): Response<Array<StarcoinAddress>>;
|
|
14
|
+
//# sourceMappingURL=starcoinGetAddress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"starcoinGetAddress.d.ts","sourceRoot":"","sources":["../../../src/types/api/starcoinGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,IAAI,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACvG,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAExD,oBAAY,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,uBAAuB,CAAC;AAE5B,oBAAY,wBAAwB,GAAG;IACrC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,YAAY,GAAG,wBAAwB,GAC9C,QAAQ,CAAC,eAAe,CAAC,CAAC;AAE7B,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,YAAY,GAAG;IAAE,MAAM,CAAC,EAAE,wBAAwB,EAAE,CAAA;CAAE,GAC7D,QAAQ,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StarcoinPublicKey as HardwareStarcoinPublicKey } from '@onekeyfe/hd-transport/src/types/messages';
|
|
2
|
+
import type { CommonParams, Response } from '../params';
|
|
3
|
+
export declare type StarcoinPublicKey = {
|
|
4
|
+
path: string;
|
|
5
|
+
} & HardwareStarcoinPublicKey;
|
|
6
|
+
export declare type StarcoinGetPublicKeyParams = {
|
|
7
|
+
path: string | number[];
|
|
8
|
+
showOnOneKey?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare function starcoinGetPublicKey(connectId: string, params: CommonParams & StarcoinGetPublicKeyParams): Response<StarcoinPublicKey>;
|
|
11
|
+
export declare function starcoinGetPublicKey(connectId: string, params: CommonParams & {
|
|
12
|
+
bundle?: StarcoinGetPublicKeyParams[];
|
|
13
|
+
}): Response<Array<StarcoinPublicKey>>;
|
|
14
|
+
//# sourceMappingURL=starcoinGetPublicKey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"starcoinGetPublicKey.d.ts","sourceRoot":"","sources":["../../../src/types/api/starcoinGetPublicKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,IAAI,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAC3G,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAExD,oBAAY,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,yBAAyB,CAAC;AAE9B,oBAAY,0BAA0B,GAAG;IACvC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAC1C,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,YAAY,GAAG,0BAA0B,GAChD,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAE/B,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAC1C,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,YAAY,GAAG;IAAE,MAAM,CAAC,EAAE,0BAA0B,EAAE,CAAA;CAAE,GAC/D,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { StarcoinMessageSignature } from '@onekeyfe/hd-transport/src/types/messages';
|
|
2
|
+
import type { CommonParams, Response } from '../params';
|
|
3
|
+
export declare type StarcoinSignMessageParams = {
|
|
4
|
+
path: string | number[];
|
|
5
|
+
messageHex: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function starcoinSignMessage(connectId: string, params: CommonParams & StarcoinSignMessageParams): Response<StarcoinMessageSignature>;
|
|
8
|
+
//# sourceMappingURL=starcoinSignMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"starcoinSignMessage.d.ts","sourceRoot":"","sources":["../../../src/types/api/starcoinSignMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAExD,oBAAY,yBAAyB,GAAG;IACtC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,mBAAmB,CACzC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,YAAY,GAAG,yBAAyB,GAC/C,QAAQ,CAAC,wBAAwB,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { StarcoinSignedTx } from '@onekeyfe/hd-transport/src/types/messages';
|
|
2
|
+
import type { CommonParams, Response } from '../params';
|
|
3
|
+
export declare type StarcoinSignTransactionParams = {
|
|
4
|
+
path: string | number[];
|
|
5
|
+
rawTx: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function starcoinSignTransaction(connectId: string, params: CommonParams & StarcoinSignTransactionParams): Response<StarcoinSignedTx>;
|
|
8
|
+
//# sourceMappingURL=starcoinSignTransaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"starcoinSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/types/api/starcoinSignTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAExD,oBAAY,6BAA6B,GAAG;IAC1C,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAC7C,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,YAAY,GAAG,6BAA6B,GACnD,QAAQ,CAAC,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Success } from '@onekeyfe/hd-transport/src/types/messages';
|
|
2
|
+
import type { CommonParams, Response } from '../params';
|
|
3
|
+
export declare type StarcoinVerifyMessageParams = {
|
|
4
|
+
publicKey: string;
|
|
5
|
+
messageHex: string;
|
|
6
|
+
signature: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function starcoinVerifyMessage(connectId: string, params: CommonParams & StarcoinVerifyMessageParams): Response<Success>;
|
|
9
|
+
//# sourceMappingURL=starcoinVerifyMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"starcoinVerifyMessage.d.ts","sourceRoot":"","sources":["../../../src/types/api/starcoinVerifyMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAExD,oBAAY,2BAA2B,GAAG;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAC3C,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,YAAY,GAAG,2BAA2B,GACjD,QAAQ,CAAC,OAAO,CAAC,CAAC"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -2,5 +2,7 @@ import { initLog, enableLog } from './logger';
|
|
|
2
2
|
export * from './assets';
|
|
3
3
|
export * from './versionUtils';
|
|
4
4
|
export * from './deferred';
|
|
5
|
+
export { getDeviceType, getDeviceUUID, getDeviceLabel } from './deviceFeaturesUtils';
|
|
6
|
+
export { getHDPath, getScriptType } from '../api/helpers/pathUtils';
|
|
5
7
|
export { initLog, enableLog };
|
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE9C,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE9C,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "OneKey",
|
|
6
6
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@onekeyfe/hd-transport": "^0.0.
|
|
28
|
+
"@onekeyfe/hd-transport": "^0.0.5",
|
|
29
29
|
"axios": "^0.27.2",
|
|
30
30
|
"bignumber.js": "^9.0.2",
|
|
31
31
|
"parse-uri": "^1.0.7",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"@types/parse-uri": "^1.0.0",
|
|
36
36
|
"@types/semver": "^7.3.9"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "24d2a28fd3f2e7fda4c21742e968bce764985615"
|
|
39
39
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { GetAddress } from '@onekeyfe/hd-transport/src/types/messages';
|
|
2
|
-
import { UI_REQUEST } from '
|
|
3
|
-
import { getScriptType, serializedPath, validatePath } from '
|
|
4
|
-
import { BaseMethod } from '
|
|
5
|
-
import { validateParams } from '
|
|
6
|
-
import { BTCAddress, BTCGetAddressParams } from '
|
|
2
|
+
import { UI_REQUEST } from '../../constants/ui-request';
|
|
3
|
+
import { getScriptType, serializedPath, validatePath } from '../helpers/pathUtils';
|
|
4
|
+
import { BaseMethod } from '../BaseMethod';
|
|
5
|
+
import { validateParams } from '../helpers/paramsValidator';
|
|
6
|
+
import { BTCAddress, BTCGetAddressParams } from '../../types/api/btcGetAddress';
|
|
7
7
|
import { getCoinInfo } from './helpers/btcParamsUtils';
|
|
8
8
|
|
|
9
9
|
export default class BTCGetAddress extends BaseMethod<GetAddress[]> {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { GetPublicKey } from '@onekeyfe/hd-transport/src/types/messages';
|
|
2
|
-
import { UI_REQUEST } from '
|
|
3
|
-
import { getScriptType, serializedPath, validatePath } from '
|
|
4
|
-
import { BaseMethod } from '
|
|
5
|
-
import { validateParams } from '
|
|
6
|
-
import { BTCGetAddressParams } from '
|
|
2
|
+
import { UI_REQUEST } from '../../constants/ui-request';
|
|
3
|
+
import { getScriptType, serializedPath, validatePath } from '../helpers/pathUtils';
|
|
4
|
+
import { BaseMethod } from '../BaseMethod';
|
|
5
|
+
import { validateParams } from '../helpers/paramsValidator';
|
|
6
|
+
import { BTCGetAddressParams } from '../../types/api/btcGetAddress';
|
|
7
7
|
import { getCoinInfo } from './helpers/btcParamsUtils';
|
|
8
|
-
import { BTCPublicKey } from '
|
|
8
|
+
import { BTCPublicKey } from '../../types/api/btcGetPublicKey';
|
|
9
9
|
|
|
10
10
|
export default class BTCGetPublicKey extends BaseMethod<GetPublicKey[]> {
|
|
11
11
|
hasBundle = false;
|
|
@@ -13,8 +13,8 @@ export default class BTCGetPublicKey extends BaseMethod<GetPublicKey[]> {
|
|
|
13
13
|
init() {
|
|
14
14
|
this.allowDeviceMode = [...this.allowDeviceMode, UI_REQUEST.INITIALIZE];
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
const payload = hasBundle ? this.payload : { bundle: [this.payload] };
|
|
16
|
+
this.hasBundle = Object.prototype.hasOwnProperty.call(this.payload, 'bundle');
|
|
17
|
+
const payload = this.hasBundle ? this.payload : { bundle: [this.payload] };
|
|
18
18
|
|
|
19
19
|
validateParams(payload, [{ name: 'bundle', type: 'array' }]);
|
|
20
20
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { SignMessage } from '@onekeyfe/hd-transport/src/types/messages';
|
|
2
|
-
import { UI_REQUEST } from '
|
|
3
|
-
import { validatePath } from '
|
|
4
|
-
import { BaseMethod } from '
|
|
5
|
-
import { validateParams } from '
|
|
6
|
-
import { formatAnyHex } from '
|
|
2
|
+
import { UI_REQUEST } from '../../constants/ui-request';
|
|
3
|
+
import { validatePath } from '../helpers/pathUtils';
|
|
4
|
+
import { BaseMethod } from '../BaseMethod';
|
|
5
|
+
import { validateParams } from '../helpers/paramsValidator';
|
|
6
|
+
import { formatAnyHex } from '../helpers/hexUtils';
|
|
7
7
|
import { getCoinAndScriptType } from './helpers/btcParamsUtils';
|
|
8
8
|
|
|
9
9
|
export default class BTCSignMessage extends BaseMethod<SignMessage> {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { TxInputType, TxOutputType } from '@onekeyfe/hd-transport/src/types/messages';
|
|
2
2
|
|
|
3
|
-
import { UI_REQUEST } from '
|
|
4
|
-
import { getOutputScriptType, isSegwitPath, validatePath } from '
|
|
5
|
-
import { BaseMethod } from '
|
|
6
|
-
import { validateParams } from '
|
|
3
|
+
import { UI_REQUEST } from '../../constants/ui-request';
|
|
4
|
+
import { getOutputScriptType, isSegwitPath, validatePath } from '../helpers/pathUtils';
|
|
5
|
+
import { BaseMethod } from '../BaseMethod';
|
|
6
|
+
import { validateParams } from '../helpers/paramsValidator';
|
|
7
7
|
import {
|
|
8
8
|
AccountAddresses,
|
|
9
9
|
BTCSignTransactionParams,
|
|
10
10
|
RefTransaction,
|
|
11
11
|
TransactionOptions,
|
|
12
|
-
} from '
|
|
13
|
-
import { ERRORS } from '
|
|
14
|
-
import signtx from './helpers/
|
|
15
|
-
import signtxLegacy from './helpers/
|
|
12
|
+
} from '../../types/api/btcSignTransaction';
|
|
13
|
+
import { ERRORS } from '../../constants';
|
|
14
|
+
import signtx from './helpers/signtx';
|
|
15
|
+
import signtxLegacy from './helpers/signtxLegacy';
|
|
16
16
|
import { getCoinInfo } from './helpers/btcParamsUtils';
|
|
17
17
|
|
|
18
18
|
type Params = {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { VerifyMessage } from '@onekeyfe/hd-transport/src/types/messages';
|
|
2
|
-
import { UI_REQUEST } from '
|
|
2
|
+
import { UI_REQUEST } from '../../constants/ui-request';
|
|
3
3
|
|
|
4
|
-
import { BaseMethod } from '
|
|
5
|
-
import { validateParams } from '
|
|
6
|
-
import { formatAnyHex } from '
|
|
4
|
+
import { BaseMethod } from '../BaseMethod';
|
|
5
|
+
import { validateParams } from '../helpers/paramsValidator';
|
|
6
|
+
import { formatAnyHex } from '../helpers/hexUtils';
|
|
7
7
|
import { getCoinInfo } from './helpers/btcParamsUtils';
|
|
8
8
|
|
|
9
9
|
export default class BTCVerifyMessage extends BaseMethod<VerifyMessage> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ERRORS } from '
|
|
2
|
-
import { getScriptType, isMultisigPath, fromHardened } from '
|
|
3
|
-
import bitcoin from '
|
|
1
|
+
import { ERRORS } from '../../../constants';
|
|
2
|
+
import { getScriptType, isMultisigPath, fromHardened } from '../../helpers/pathUtils';
|
|
3
|
+
import bitcoin from '../../../data/coins/bitcoin.json';
|
|
4
4
|
|
|
5
5
|
export type BitcoinInfo = {
|
|
6
6
|
name: string;
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChangePin } from '@onekeyfe/hd-transport/src/types/messages';
|
|
2
|
-
import { BaseMethod } from '
|
|
3
|
-
import { validateParams } from '
|
|
2
|
+
import { BaseMethod } from '../BaseMethod';
|
|
3
|
+
import { validateParams } from '../helpers/paramsValidator';
|
|
4
4
|
|
|
5
5
|
export default class DeviceChangePin extends BaseMethod<ChangePin> {
|
|
6
6
|
init() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApplyFlags } from '@onekeyfe/hd-transport/src/types/messages';
|
|
2
|
-
import { BaseMethod } from '
|
|
3
|
-
import { validateParams } from '
|
|
2
|
+
import { BaseMethod } from '../BaseMethod';
|
|
3
|
+
import { validateParams } from '../helpers/paramsValidator';
|
|
4
4
|
|
|
5
5
|
export default class DeviceFlags extends BaseMethod<ApplyFlags> {
|
|
6
6
|
init() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RebootToBootloader } from '@onekeyfe/hd-transport/src/types/messages';
|
|
2
|
-
import { BaseMethod } from '
|
|
2
|
+
import { BaseMethod } from '../BaseMethod';
|
|
3
3
|
|
|
4
4
|
// Reboot BootLoader
|
|
5
5
|
export default class DeviceRebootToBootloader extends BaseMethod<RebootToBootloader> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RecoveryDevice } from '@onekeyfe/hd-transport/src/types/messages';
|
|
2
|
-
import { BaseMethod } from '
|
|
3
|
-
import { validateParams } from '
|
|
2
|
+
import { BaseMethod } from '../BaseMethod';
|
|
3
|
+
import { validateParams } from '../helpers/paramsValidator';
|
|
4
4
|
|
|
5
5
|
export default class DeviceRecovery extends BaseMethod<RecoveryDevice> {
|
|
6
6
|
init() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ResetDevice } from '@onekeyfe/hd-transport/src/types/messages';
|
|
2
|
-
import { BaseMethod } from '
|
|
3
|
-
import { validateParams } from '
|
|
2
|
+
import { BaseMethod } from '../BaseMethod';
|
|
3
|
+
import { validateParams } from '../helpers/paramsValidator';
|
|
4
4
|
|
|
5
5
|
export default class DeviceReset extends BaseMethod<ResetDevice> {
|
|
6
6
|
init() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApplySettings } from '@onekeyfe/hd-transport/src/types/messages';
|
|
2
|
-
import { BaseMethod } from '
|
|
3
|
-
import { validateParams } from '
|
|
2
|
+
import { BaseMethod } from '../BaseMethod';
|
|
3
|
+
import { validateParams } from '../helpers/paramsValidator';
|
|
4
4
|
|
|
5
5
|
export default class DeviceSettings extends BaseMethod<ApplySettings> {
|
|
6
6
|
init() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BixinReboot } from '@onekeyfe/hd-transport/src/types/messages';
|
|
2
|
-
import { BaseMethod } from '
|
|
2
|
+
import { BaseMethod } from '../BaseMethod';
|
|
3
3
|
|
|
4
4
|
// Upload hint Reboot BootLoader
|
|
5
5
|
export default class DeviceUpdateReboot extends BaseMethod<BixinReboot> {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EthereumGetAddress } from '@onekeyfe/hd-transport/src/types/messages';
|
|
2
|
-
import { UI_REQUEST } from '
|
|
3
|
-
import { serializedPath, validatePath } from '
|
|
4
|
-
import { BaseMethod } from '
|
|
5
|
-
import { validateParams } from '
|
|
6
|
-
import { EVMAddress, EVMGetAddressParams } from '
|
|
2
|
+
import { UI_REQUEST } from '../../constants/ui-request';
|
|
3
|
+
import { serializedPath, validatePath } from '../helpers/pathUtils';
|
|
4
|
+
import { BaseMethod } from '../BaseMethod';
|
|
5
|
+
import { validateParams } from '../helpers/paramsValidator';
|
|
6
|
+
import { EVMAddress, EVMGetAddressParams } from '../../types/api/evmGetAddress';
|
|
7
7
|
|
|
8
8
|
export default class EvmGetAddress extends BaseMethod<EthereumGetAddress[]> {
|
|
9
9
|
hasBundle = false;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EthereumGetPublicKey } from '@onekeyfe/hd-transport/src/types/messages';
|
|
2
|
-
import { UI_REQUEST } from '
|
|
3
|
-
import { serializedPath, validatePath } from '
|
|
4
|
-
import { BaseMethod } from '
|
|
5
|
-
import { validateParams } from '
|
|
6
|
-
import { EVMGetPublicKeyParams, EVMPublicKey } from '
|
|
2
|
+
import { UI_REQUEST } from '../../constants/ui-request';
|
|
3
|
+
import { serializedPath, validatePath } from '../helpers/pathUtils';
|
|
4
|
+
import { BaseMethod } from '../BaseMethod';
|
|
5
|
+
import { validateParams } from '../helpers/paramsValidator';
|
|
6
|
+
import { EVMGetPublicKeyParams, EVMPublicKey } from '../../types/api/evmGetPublicKey';
|
|
7
7
|
|
|
8
8
|
export default class EVMGetPublicKey extends BaseMethod<EthereumGetPublicKey[]> {
|
|
9
9
|
hasBundle = false;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EthereumSignMessage } from '@onekeyfe/hd-transport/src/types/messages';
|
|
2
|
-
import { UI_REQUEST } from '
|
|
3
|
-
import { validatePath } from '
|
|
4
|
-
import { BaseMethod } from '
|
|
5
|
-
import { validateParams } from '
|
|
6
|
-
import { formatAnyHex } from '
|
|
2
|
+
import { UI_REQUEST } from '../../constants/ui-request';
|
|
3
|
+
import { validatePath } from '../helpers/pathUtils';
|
|
4
|
+
import { BaseMethod } from '../BaseMethod';
|
|
5
|
+
import { validateParams } from '../helpers/paramsValidator';
|
|
6
|
+
import { formatAnyHex } from '../helpers/hexUtils';
|
|
7
7
|
|
|
8
8
|
export default class EVMSignMessage extends BaseMethod<EthereumSignMessage> {
|
|
9
9
|
init() {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EthereumSignMessageEIP712 } from '@onekeyfe/hd-transport/src/types/messages';
|
|
2
|
-
import { UI_REQUEST } from '
|
|
3
|
-
import { validatePath } from '
|
|
4
|
-
import { BaseMethod } from '
|
|
5
|
-
import { validateParams } from '
|
|
6
|
-
import { formatAnyHex } from '
|
|
2
|
+
import { UI_REQUEST } from '../../constants/ui-request';
|
|
3
|
+
import { validatePath } from '../helpers/pathUtils';
|
|
4
|
+
import { BaseMethod } from '../BaseMethod';
|
|
5
|
+
import { validateParams } from '../helpers/paramsValidator';
|
|
6
|
+
import { formatAnyHex } from '../helpers/hexUtils';
|
|
7
7
|
|
|
8
8
|
export default class EVMSignMessageEIP712 extends BaseMethod<EthereumSignMessageEIP712> {
|
|
9
9
|
init() {
|
|
@@ -4,19 +4,19 @@ import {
|
|
|
4
4
|
EthereumTxRequest,
|
|
5
5
|
} from '@onekeyfe/hd-transport/src/types/messages';
|
|
6
6
|
|
|
7
|
-
import { UI_REQUEST } from '
|
|
8
|
-
import { validatePath } from '
|
|
9
|
-
import { BaseMethod } from '
|
|
10
|
-
import { SchemaParam, validateParams } from '
|
|
7
|
+
import { UI_REQUEST } from '../../constants/ui-request';
|
|
8
|
+
import { validatePath } from '../helpers/pathUtils';
|
|
9
|
+
import { BaseMethod } from '../BaseMethod';
|
|
10
|
+
import { SchemaParam, validateParams } from '../helpers/paramsValidator';
|
|
11
11
|
import {
|
|
12
12
|
EVMSignedTx,
|
|
13
13
|
EVMSignTransactionParams,
|
|
14
14
|
EVMTransaction,
|
|
15
15
|
EVMTransactionEIP1559,
|
|
16
|
-
} from '
|
|
17
|
-
import { cutString } from '
|
|
18
|
-
import { formatAnyHex, stripHexStartZeroes } from '
|
|
19
|
-
import { ERRORS } from '
|
|
16
|
+
} from '../../types/api/evmSignTransaction';
|
|
17
|
+
import { cutString } from '../helpers/stringUtils';
|
|
18
|
+
import { formatAnyHex, stripHexStartZeroes } from '../helpers/hexUtils';
|
|
19
|
+
import { ERRORS } from '../../constants';
|
|
20
20
|
|
|
21
21
|
export default class EVMSignTransaction extends BaseMethod {
|
|
22
22
|
addressN: number[] = [];
|
|
@@ -70,7 +70,7 @@ export default class EVMSignTransaction extends BaseMethod {
|
|
|
70
70
|
const r = request.signature_r;
|
|
71
71
|
const s = request.signature_s;
|
|
72
72
|
|
|
73
|
-
if (
|
|
73
|
+
if (v == null || r == null || s == null) {
|
|
74
74
|
throw ERRORS.TypedError('Runtime', 'processTxRequest: Unexpected request');
|
|
75
75
|
}
|
|
76
76
|
|
|
@@ -3,17 +3,17 @@ import {
|
|
|
3
3
|
EthereumTypedDataStructAck,
|
|
4
4
|
MessageKey,
|
|
5
5
|
} from '@onekeyfe/hd-transport/src/types/messages';
|
|
6
|
-
import { UI_REQUEST } from '
|
|
7
|
-
import { validatePath } from '
|
|
8
|
-
import { BaseMethod } from '
|
|
9
|
-
import { validateParams } from '
|
|
10
|
-
import { formatAnyHex } from '
|
|
11
|
-
import { ERRORS } from '
|
|
12
|
-
import { encodeData, getFieldType, parseArrayType } from '
|
|
6
|
+
import { UI_REQUEST } from '../../constants/ui-request';
|
|
7
|
+
import { validatePath } from '../helpers/pathUtils';
|
|
8
|
+
import { BaseMethod } from '../BaseMethod';
|
|
9
|
+
import { validateParams } from '../helpers/paramsValidator';
|
|
10
|
+
import { formatAnyHex } from '../helpers/hexUtils';
|
|
11
|
+
import { ERRORS } from '../../constants';
|
|
12
|
+
import { encodeData, getFieldType, parseArrayType } from '../helpers/typeNameUtils';
|
|
13
13
|
import {
|
|
14
14
|
EthereumSignTypedDataMessage,
|
|
15
15
|
EthereumSignTypedDataTypes,
|
|
16
|
-
} from '
|
|
16
|
+
} from '../../types/api/evmSignTypedData';
|
|
17
17
|
|
|
18
18
|
export type EVMSignTypedDataParams = {
|
|
19
19
|
addressN: number[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { EthereumVerifyMessage } from '@onekeyfe/hd-transport/src/types/messages';
|
|
2
|
-
import { UI_REQUEST } from '
|
|
3
|
-
import { BaseMethod } from '
|
|
4
|
-
import { validateParams } from '
|
|
5
|
-
import { formatAnyHex } from '
|
|
2
|
+
import { UI_REQUEST } from '../../constants/ui-request';
|
|
3
|
+
import { BaseMethod } from '../BaseMethod';
|
|
4
|
+
import { validateParams } from '../helpers/paramsValidator';
|
|
5
|
+
import { formatAnyHex } from '../helpers/hexUtils';
|
|
6
6
|
|
|
7
7
|
export default class EVMSignMessage extends BaseMethod<EthereumVerifyMessage> {
|
|
8
8
|
init() {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { ChangeOutputScriptType, InputScriptType } from '@onekeyfe/hd-transport/src/types/messages';
|
|
4
4
|
import { ERRORS } from '../../constants';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const HD_HARDENED = 0x80000000;
|
|
7
7
|
export const toHardened = (n: number): number => (n | HD_HARDENED) >>> 0;
|
|
8
8
|
export const fromHardened = (n: number): number => (n & ~HD_HARDENED) >>> 0;
|
|
9
9
|
|
package/src/api/index.ts
CHANGED
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
export { default as searchDevices } from './SearchDevices';
|
|
2
2
|
export { default as getFeatures } from './GetFeatures';
|
|
3
|
-
export { default as btcGetAddress } from './BTCGetAddress';
|
|
4
|
-
export { default as btcGetPublicKey } from './BTCGetPublicKey';
|
|
5
|
-
export { default as btcSignMessage } from './BTCSignMessage';
|
|
6
|
-
export { default as btcSignTransaction } from './BTCSignTransaction';
|
|
7
|
-
export { default as btcVerifyMessage } from './BTCVerifyMessage';
|
|
3
|
+
export { default as btcGetAddress } from './btc/BTCGetAddress';
|
|
4
|
+
export { default as btcGetPublicKey } from './btc/BTCGetPublicKey';
|
|
5
|
+
export { default as btcSignMessage } from './btc/BTCSignMessage';
|
|
6
|
+
export { default as btcSignTransaction } from './btc/BTCSignTransaction';
|
|
7
|
+
export { default as btcVerifyMessage } from './btc/BTCVerifyMessage';
|
|
8
8
|
export { default as checkFirmwareRelease } from './CheckFirmwareRelease';
|
|
9
9
|
export { default as checkBLEFirmwareRelease } from './CheckBLEFirmwareRelease';
|
|
10
10
|
export { default as checkTransportRelease } from './CheckTransportRelease';
|
|
11
|
-
export { default as deviceBackup } from './DeviceBackup';
|
|
12
|
-
export { default as deviceChangePin } from './DeviceChangePin';
|
|
13
|
-
export { default as deviceFlags } from './DeviceFlags';
|
|
14
|
-
export { default as deviceRebootToBootloader } from './DeviceRebootToBootloader';
|
|
15
|
-
export { default as deviceRecovery } from './DeviceRecovery';
|
|
16
|
-
export { default as deviceReset } from './DeviceReset';
|
|
17
|
-
export { default as deviceSettings } from './DeviceSettings';
|
|
18
|
-
export { default as deviceUpdateReboot } from './DeviceUpdateReboot';
|
|
19
|
-
export { default as deviceWipe } from './DeviceWipe';
|
|
20
|
-
export { default as evmGetAddress } from './EVMGetAddress';
|
|
21
|
-
export { default as evmGetPublicKey } from './EVMGetPublicKey';
|
|
22
|
-
export { default as evmSignMessage } from './EVMSignMessage';
|
|
23
|
-
export { default as evmSignMessageEIP712 } from './EVMSignMessageEIP712';
|
|
24
|
-
export { default as evmSignTransaction } from './EVMSignTransaction';
|
|
25
|
-
export { default as evmSignTypedData } from './EVMSignTypedData';
|
|
26
|
-
export { default as evmVerifyMessage } from './EVMVerifyMessage';
|
|
11
|
+
export { default as deviceBackup } from './device/DeviceBackup';
|
|
12
|
+
export { default as deviceChangePin } from './device/DeviceChangePin';
|
|
13
|
+
export { default as deviceFlags } from './device/DeviceFlags';
|
|
14
|
+
export { default as deviceRebootToBootloader } from './device/DeviceRebootToBootloader';
|
|
15
|
+
export { default as deviceRecovery } from './device/DeviceRecovery';
|
|
16
|
+
export { default as deviceReset } from './device/DeviceReset';
|
|
17
|
+
export { default as deviceSettings } from './device/DeviceSettings';
|
|
18
|
+
export { default as deviceUpdateReboot } from './device/DeviceUpdateReboot';
|
|
19
|
+
export { default as deviceWipe } from './device/DeviceWipe';
|
|
20
|
+
export { default as evmGetAddress } from './evm/EVMGetAddress';
|
|
21
|
+
export { default as evmGetPublicKey } from './evm/EVMGetPublicKey';
|
|
22
|
+
export { default as evmSignMessage } from './evm/EVMSignMessage';
|
|
23
|
+
export { default as evmSignMessageEIP712 } from './evm/EVMSignMessageEIP712';
|
|
24
|
+
export { default as evmSignTransaction } from './evm/EVMSignTransaction';
|
|
25
|
+
export { default as evmSignTypedData } from './evm/EVMSignTypedData';
|
|
26
|
+
export { default as evmVerifyMessage } from './evm/EVMVerifyMessage';
|
|
27
|
+
export { default as starcoinGetAddress } from './starcoin/StarcoinGetAddress';
|
|
28
|
+
export { default as starcoinGetPublicKey } from './starcoin/StarcoinGetPublicKey';
|
|
29
|
+
export { default as starcoinSignMessage } from './starcoin/StarcoinSignMessage';
|
|
30
|
+
export { default as starcoinSignTransaction } from './starcoin/StarcoinSignTransaction';
|
|
31
|
+
export { default as starcoinVerifyMessage } from './starcoin/StarcoinVerifyMessage';
|