@onekeyfe/hd-core 0.0.8 → 0.1.0
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 +4 -0
- package/dist/api/BaseMethod.d.ts.map +1 -1
- package/dist/api/CipherKeyValue.d.ts +9 -0
- package/dist/api/CipherKeyValue.d.ts.map +1 -0
- package/dist/api/FirmwareUpdate.d.ts +14 -0
- package/dist/api/FirmwareUpdate.d.ts.map +1 -0
- package/dist/api/device/DeviceRebootToBootloader.d.ts +8 -0
- package/dist/api/device/DeviceRebootToBootloader.d.ts.map +1 -1
- package/dist/api/evm/EVMSignMessageEIP712.d.ts +5 -0
- package/dist/api/evm/EVMSignMessageEIP712.d.ts.map +1 -1
- package/dist/api/evm/EVMSignTransaction.d.ts +5 -0
- package/dist/api/evm/EVMSignTransaction.d.ts.map +1 -1
- package/dist/api/evm/EVMSignTypedData.d.ts +7 -1
- package/dist/api/evm/EVMSignTypedData.d.ts.map +1 -1
- package/dist/api/firmware/getBinary.d.ts +33 -0
- package/dist/api/firmware/getBinary.d.ts.map +1 -0
- package/dist/api/firmware/uploadFirmware.d.ts +8 -0
- package/dist/api/firmware/uploadFirmware.d.ts.map +1 -0
- package/dist/api/helpers/hexUtils.d.ts.map +1 -1
- package/dist/api/index.d.ts +8 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/nem/NEMGetAddress.d.ts +9 -0
- package/dist/api/nem/NEMGetAddress.d.ts.map +1 -0
- package/dist/api/nem/NEMSignTransaction.d.ts +20 -0
- package/dist/api/nem/NEMSignTransaction.d.ts.map +1 -0
- package/dist/api/solana/SolGetAddress.d.ts +9 -0
- package/dist/api/solana/SolGetAddress.d.ts.map +1 -0
- package/dist/api/solana/SolSignTransaction.d.ts +17 -0
- package/dist/api/solana/SolSignTransaction.d.ts.map +1 -0
- package/dist/api/stellar/StellarGetAddress.d.ts +9 -0
- package/dist/api/stellar/StellarGetAddress.d.ts.map +1 -0
- package/dist/api/stellar/StellarSignTransaction.d.ts +335 -0
- package/dist/api/stellar/StellarSignTransaction.d.ts.map +1 -0
- package/dist/constants/errors.d.ts +1 -0
- package/dist/constants/errors.d.ts.map +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/data/version.d.ts +1 -1
- package/dist/data/version.d.ts.map +1 -1
- package/dist/device/Device.d.ts +1 -0
- package/dist/device/Device.d.ts.map +1 -1
- package/dist/device/DeviceCommands.d.ts +1 -0
- package/dist/device/DeviceCommands.d.ts.map +1 -1
- package/dist/events/ui-request.d.ts +9 -1
- package/dist/events/ui-request.d.ts.map +1 -1
- package/dist/index.d.ts +364 -5
- package/dist/index.js +845 -21
- package/dist/inject.d.ts.map +1 -1
- package/dist/types/api/cipherKeyValue.d.ts +19 -0
- package/dist/types/api/cipherKeyValue.d.ts.map +1 -0
- package/dist/types/api/export.d.ts +7 -0
- package/dist/types/api/export.d.ts.map +1 -1
- package/dist/types/api/firmwareUpdate.d.ts +13 -0
- package/dist/types/api/firmwareUpdate.d.ts.map +1 -0
- package/dist/types/api/index.d.ts +16 -0
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/nemGetAddress.d.ts +15 -0
- package/dist/types/api/nemGetAddress.d.ts.map +1 -0
- package/dist/types/api/nemSignTransaction.d.ts +93 -0
- package/dist/types/api/nemSignTransaction.d.ts.map +1 -0
- package/dist/types/api/solGetAddress.d.ts +14 -0
- package/dist/types/api/solGetAddress.d.ts.map +1 -0
- package/dist/types/api/solSignTransaction.d.ts +14 -0
- package/dist/types/api/solSignTransaction.d.ts.map +1 -0
- package/dist/types/api/stellarGetAddress.d.ts +14 -0
- package/dist/types/api/stellarGetAddress.d.ts.map +1 -0
- package/dist/types/api/stellarSignTransaction.d.ts +130 -0
- package/dist/types/api/stellarSignTransaction.d.ts.map +1 -0
- package/dist/types/device.d.ts +45 -0
- package/dist/types/device.d.ts.map +1 -1
- package/dist/types/firmware.d.ts +2 -1
- package/dist/types/firmware.d.ts.map +1 -1
- package/dist/types/params.d.ts +3 -0
- package/dist/types/params.d.ts.map +1 -1
- package/dist/utils/assets.d.ts +1 -1
- package/dist/utils/assets.d.ts.map +1 -1
- package/dist/utils/deviceFeaturesUtils.d.ts +49 -2
- package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
- package/dist/utils/networkUtils.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/api/BaseMethod.ts +9 -0
- package/src/api/CipherKeyValue.ts +66 -0
- package/src/api/FirmwareUpdate.ts +78 -0
- package/src/api/device/DeviceRebootToBootloader.ts +11 -0
- package/src/api/evm/EVMSignMessageEIP712.ts +8 -0
- package/src/api/evm/EVMSignTransaction.ts +15 -0
- package/src/api/evm/EVMSignTypedData.ts +55 -15
- package/src/api/firmware/getBinary.ts +46 -0
- package/src/api/firmware/uploadFirmware.ts +72 -0
- package/src/api/helpers/hexUtils.ts +0 -1
- package/src/api/index.ts +12 -0
- package/src/api/nem/NEMGetAddress.ts +61 -0
- package/src/api/nem/NEMSignTransaction.ts +246 -0
- package/src/api/solana/SolGetAddress.ts +59 -0
- package/src/api/solana/SolSignTransaction.ts +69 -0
- package/src/api/stellar/StellarGetAddress.ts +59 -0
- package/src/api/stellar/StellarSignTransaction.ts +213 -0
- package/src/constants/errors.ts +1 -0
- package/src/core/index.ts +40 -5
- package/src/data/version.ts +1 -1
- package/src/device/Device.ts +4 -0
- package/src/device/DeviceCommands.ts +2 -0
- package/src/events/ui-request.ts +15 -1
- package/src/inject.ts +17 -0
- package/src/types/api/cipherKeyValue.ts +26 -0
- package/src/types/api/export.ts +27 -0
- package/src/types/api/firmwareUpdate.ts +21 -0
- package/src/types/api/index.ts +21 -0
- package/src/types/api/nemGetAddress.ts +22 -0
- package/src/types/api/nemSignTransaction.ts +117 -0
- package/src/types/api/solGetAddress.ts +21 -0
- package/src/types/api/solSignTransaction.ts +21 -0
- package/src/types/api/stellarGetAddress.ts +21 -0
- package/src/types/api/stellarSignTransaction.ts +153 -0
- package/src/types/device.ts +52 -0
- package/src/types/firmware.ts +2 -1
- package/src/types/params.ts +2 -0
- package/src/utils/assets.ts +1 -1
- package/src/utils/deviceFeaturesUtils.ts +16 -2
- package/src/utils/networkUtils.ts +3 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import EventEmitter, { EventEmitter as EventEmitter$1 } from 'events';
|
|
2
2
|
import { Messages, Transport, OneKeyDeviceInfo } from '@onekeyfe/hd-transport';
|
|
3
3
|
export { Messages as PROTO } from '@onekeyfe/hd-transport';
|
|
4
|
-
import { EthereumPublicKey, EthereumMessageSignature, Success as Success$1, Address, MultisigRedeemScriptType, InputScriptType, PublicKey, MessageSignature, PrevInput, TxOutputBinType, TxInput, TxOutputType, TxInputType, RecoveryDeviceType, SafetyCheckLevel, StarcoinAddress as StarcoinAddress$1, StarcoinPublicKey as StarcoinPublicKey$1, StarcoinMessageSignature, StarcoinSignedTx } from '@onekeyfe/hd-transport/src/types/messages';
|
|
4
|
+
import { EthereumPublicKey, EthereumMessageSignature, Success as Success$1, Address, MultisigRedeemScriptType, InputScriptType, PublicKey, MessageSignature, PrevInput, TxOutputBinType, TxInput, TxOutputType, TxInputType, RecoveryDeviceType, SafetyCheckLevel, StarcoinAddress as StarcoinAddress$1, StarcoinPublicKey as StarcoinPublicKey$1, StarcoinMessageSignature, StarcoinSignedTx, NEMAddress as NEMAddress$1, NEMSignedTx, SolanaAddress as SolanaAddress$1, SolanaSignedTx as SolanaSignedTx$1, StellarAddress as StellarAddress$1, StellarSignedTx, CipheredKeyValue as CipheredKeyValue$1 } from '@onekeyfe/hd-transport/src/types/messages';
|
|
5
5
|
|
|
6
6
|
interface CommonParams {
|
|
7
7
|
keepSession?: boolean;
|
|
8
8
|
}
|
|
9
|
+
declare type Params<T> = CommonParams & T & {
|
|
10
|
+
bundle?: undefined;
|
|
11
|
+
};
|
|
9
12
|
interface Unsuccessful {
|
|
10
13
|
success: false;
|
|
11
14
|
payload: {
|
|
@@ -27,6 +30,7 @@ declare const ERROR_CODES: {
|
|
|
27
30
|
Method_InvalidParameter: string;
|
|
28
31
|
Call_API: string;
|
|
29
32
|
Call_NotResponse: string;
|
|
33
|
+
Method_FirmwareUpdate_DownloadFailed: string;
|
|
30
34
|
Transport_InvalidProtobuf: string;
|
|
31
35
|
Device_FwException: string;
|
|
32
36
|
Device_UnexpectedMode: string;
|
|
@@ -157,9 +161,53 @@ declare type SearchDevice = {
|
|
|
157
161
|
declare type Device$1 = KnownDevice;
|
|
158
162
|
declare type Features = Messages.Features;
|
|
159
163
|
declare type IDeviceType = 'classic' | 'mini' | 'touch' | 'pro';
|
|
164
|
+
declare type IDeviceModel = 'model_mini' | 'model_touch';
|
|
160
165
|
declare type IDeviceFirmwareStatus = 'valid' | 'outdated' | 'required' | 'unknown' | 'none';
|
|
161
166
|
declare type IDeviceBLEFirmwareStatus = 'valid' | 'outdated' | 'required' | 'unknown' | 'none';
|
|
162
167
|
declare type ITransportStatus = 'valid' | 'outdated';
|
|
168
|
+
declare type DeviceFirmwareRange = {
|
|
169
|
+
[deviceType in IDeviceType | IDeviceModel]?: {
|
|
170
|
+
min: string;
|
|
171
|
+
max?: string;
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
declare type FeaturesNarrowing = {
|
|
175
|
+
major_version: 2;
|
|
176
|
+
fw_major: null;
|
|
177
|
+
fw_minor: null;
|
|
178
|
+
fw_patch: null;
|
|
179
|
+
bootloader_mode: true;
|
|
180
|
+
firmware_present: false;
|
|
181
|
+
} | {
|
|
182
|
+
major_version: 2;
|
|
183
|
+
fw_major: null;
|
|
184
|
+
fw_minor: null;
|
|
185
|
+
fw_patch: null;
|
|
186
|
+
bootloader_mode: null;
|
|
187
|
+
firmware_present: null;
|
|
188
|
+
} | {
|
|
189
|
+
major_version: 2;
|
|
190
|
+
fw_major: 2;
|
|
191
|
+
fw_minor: number;
|
|
192
|
+
fw_patch: number;
|
|
193
|
+
bootloader_mode: true;
|
|
194
|
+
firmware_present: true;
|
|
195
|
+
} | {
|
|
196
|
+
major_version: 1;
|
|
197
|
+
fw_major: null;
|
|
198
|
+
fw_minor: null;
|
|
199
|
+
fw_patch: null;
|
|
200
|
+
bootloader_mode: true;
|
|
201
|
+
firmware_present: false;
|
|
202
|
+
} | {
|
|
203
|
+
major_version: 1;
|
|
204
|
+
fw_major: null;
|
|
205
|
+
fw_minor: null;
|
|
206
|
+
fw_patch: null;
|
|
207
|
+
bootloader_mode: true;
|
|
208
|
+
firmware_present: true;
|
|
209
|
+
};
|
|
210
|
+
declare type StrictFeatures = Features & FeaturesNarrowing;
|
|
163
211
|
|
|
164
212
|
declare function searchDevices(): Response<SearchDevice[]>;
|
|
165
213
|
|
|
@@ -181,7 +229,8 @@ interface FirmwareRange {
|
|
|
181
229
|
max: string;
|
|
182
230
|
};
|
|
183
231
|
}
|
|
184
|
-
declare type
|
|
232
|
+
declare type MajorVersion = 1 | 2;
|
|
233
|
+
declare type VersionArray = [MajorVersion, number, number];
|
|
185
234
|
declare type FirmwareRelease = {
|
|
186
235
|
required: boolean;
|
|
187
236
|
url: string;
|
|
@@ -545,6 +594,299 @@ declare type StarcoinVerifyMessageParams = {
|
|
|
545
594
|
};
|
|
546
595
|
declare function starcoinVerifyMessage(connectId: string, params: CommonParams & StarcoinVerifyMessageParams): Response<Success$1>;
|
|
547
596
|
|
|
597
|
+
declare type NEMAddress = {
|
|
598
|
+
path: string;
|
|
599
|
+
} & NEMAddress$1;
|
|
600
|
+
declare type NEMGetAddressParams = {
|
|
601
|
+
path: string | number[];
|
|
602
|
+
network?: number;
|
|
603
|
+
showOnOneKey?: boolean;
|
|
604
|
+
};
|
|
605
|
+
declare function nemGetAddress(connectId: string, params: CommonParams & NEMGetAddressParams): Response<NEMAddress>;
|
|
606
|
+
declare function nemGetAddress(connectId: string, params: CommonParams & {
|
|
607
|
+
bundle?: NEMGetAddressParams[];
|
|
608
|
+
}): Response<Array<NEMAddress>>;
|
|
609
|
+
|
|
610
|
+
declare type MosaicID = {
|
|
611
|
+
namespaceId: string;
|
|
612
|
+
name: string;
|
|
613
|
+
};
|
|
614
|
+
declare type MosaicDefinition = {
|
|
615
|
+
levy?: {
|
|
616
|
+
type?: number;
|
|
617
|
+
fee?: number;
|
|
618
|
+
recipient?: string;
|
|
619
|
+
mosaicId?: MosaicID;
|
|
620
|
+
};
|
|
621
|
+
id: MosaicID;
|
|
622
|
+
description: string;
|
|
623
|
+
properties?: Array<{
|
|
624
|
+
name: 'divisibility' | 'initialSupply' | 'supplyMutable' | 'transferable';
|
|
625
|
+
value: string;
|
|
626
|
+
}>;
|
|
627
|
+
};
|
|
628
|
+
declare type NEMMosaic = {
|
|
629
|
+
mosaicId: MosaicID;
|
|
630
|
+
quantity: number;
|
|
631
|
+
};
|
|
632
|
+
declare type Modification = {
|
|
633
|
+
modificationType: number;
|
|
634
|
+
cosignatoryAccount: string;
|
|
635
|
+
};
|
|
636
|
+
declare type Message = {
|
|
637
|
+
payload?: string;
|
|
638
|
+
type?: number;
|
|
639
|
+
publicKey?: string;
|
|
640
|
+
};
|
|
641
|
+
declare type TransactionCommon = {
|
|
642
|
+
version: number;
|
|
643
|
+
timeStamp: number;
|
|
644
|
+
fee: number;
|
|
645
|
+
deadline?: number;
|
|
646
|
+
signer?: string;
|
|
647
|
+
};
|
|
648
|
+
declare type NEMTransferTransaction = TransactionCommon & {
|
|
649
|
+
type: 0x0101;
|
|
650
|
+
recipient: string;
|
|
651
|
+
amount: number | string;
|
|
652
|
+
mosaics?: NEMMosaic[];
|
|
653
|
+
message?: Message;
|
|
654
|
+
};
|
|
655
|
+
declare type NEMImportanceTransaction = TransactionCommon & {
|
|
656
|
+
type: 0x0801;
|
|
657
|
+
importanceTransfer: {
|
|
658
|
+
mode: number;
|
|
659
|
+
publicKey: string;
|
|
660
|
+
};
|
|
661
|
+
};
|
|
662
|
+
declare type NEMAggregateModificationTransaction = TransactionCommon & {
|
|
663
|
+
type: 0x1001;
|
|
664
|
+
modifications?: Modification[];
|
|
665
|
+
minCosignatories: {
|
|
666
|
+
relativeChange: number;
|
|
667
|
+
};
|
|
668
|
+
};
|
|
669
|
+
declare type NEMProvisionNamespaceTransaction = TransactionCommon & {
|
|
670
|
+
type: 0x2001;
|
|
671
|
+
newPart?: string;
|
|
672
|
+
parent?: string;
|
|
673
|
+
rentalFeeSink?: string;
|
|
674
|
+
rentalFee?: number;
|
|
675
|
+
};
|
|
676
|
+
declare type NEMMosaicCreationTransaction = TransactionCommon & {
|
|
677
|
+
type: 0x4001;
|
|
678
|
+
mosaicDefinition: MosaicDefinition;
|
|
679
|
+
creationFeeSink?: string;
|
|
680
|
+
creationFee?: number;
|
|
681
|
+
};
|
|
682
|
+
declare type NEMSupplyChangeTransaction = TransactionCommon & {
|
|
683
|
+
type: 0x4002;
|
|
684
|
+
mosaicId: MosaicID;
|
|
685
|
+
supplyType: number;
|
|
686
|
+
delta?: number;
|
|
687
|
+
};
|
|
688
|
+
declare type Transaction = NEMTransferTransaction | NEMImportanceTransaction | NEMAggregateModificationTransaction | NEMProvisionNamespaceTransaction | NEMMosaicCreationTransaction | NEMSupplyChangeTransaction;
|
|
689
|
+
declare type NEMMultisigTransaction = TransactionCommon & {
|
|
690
|
+
type: 0x0102 | 0x1002 | 0x1004;
|
|
691
|
+
otherTrans: Transaction;
|
|
692
|
+
};
|
|
693
|
+
declare type NEMTransaction = Transaction | NEMMultisigTransaction;
|
|
694
|
+
declare type NEMSignTransactionParams = {
|
|
695
|
+
path: string | number[];
|
|
696
|
+
transaction: NEMTransaction;
|
|
697
|
+
};
|
|
698
|
+
declare function nemSignTransaction(connectId: string, params: CommonParams & NEMSignTransactionParams): Response<NEMSignedTx>;
|
|
699
|
+
|
|
700
|
+
declare type SolanaAddress = {
|
|
701
|
+
path: string;
|
|
702
|
+
} & SolanaAddress$1;
|
|
703
|
+
declare type SolanaGetAddressParams = {
|
|
704
|
+
path: string | number[];
|
|
705
|
+
showOnOneKey?: boolean;
|
|
706
|
+
};
|
|
707
|
+
declare function solGetAddress(connectId: string, params: CommonParams & SolanaGetAddressParams): Response<SolanaAddress>;
|
|
708
|
+
declare function solGetAddress(connectId: string, params: CommonParams & {
|
|
709
|
+
bundle?: SolanaGetAddressParams[];
|
|
710
|
+
}): Response<Array<SolanaAddress>>;
|
|
711
|
+
|
|
712
|
+
declare type SolanaSignedTx = {
|
|
713
|
+
path: string;
|
|
714
|
+
} & SolanaSignedTx$1;
|
|
715
|
+
declare type SolanaSignTransactionParams = {
|
|
716
|
+
path: string | number[];
|
|
717
|
+
rawTx?: string;
|
|
718
|
+
};
|
|
719
|
+
declare function solSignTransaction(connectId: string, params: CommonParams & SolanaSignTransactionParams): Response<SolanaSignedTx>;
|
|
720
|
+
declare function solSignTransaction(connectId: string, params: CommonParams & {
|
|
721
|
+
bundle?: SolanaSignTransactionParams[];
|
|
722
|
+
}): Response<Array<SolanaSignedTx>>;
|
|
723
|
+
|
|
724
|
+
declare type StellarAddress = {
|
|
725
|
+
path: string;
|
|
726
|
+
} & StellarAddress$1;
|
|
727
|
+
declare type StellarGetAddressParams = {
|
|
728
|
+
path: string | number[];
|
|
729
|
+
showOnOneKey?: boolean;
|
|
730
|
+
};
|
|
731
|
+
declare function stellarGetAddress(connectId: string, params: CommonParams & StellarGetAddressParams): Response<StellarAddress>;
|
|
732
|
+
declare function stellarGetAddress(connectId: string, params: CommonParams & {
|
|
733
|
+
bundle?: StellarGetAddressParams[];
|
|
734
|
+
}): Response<Array<StellarAddress>>;
|
|
735
|
+
|
|
736
|
+
declare type StellarAsset = {
|
|
737
|
+
type: 0 | 1 | 2;
|
|
738
|
+
code: string;
|
|
739
|
+
issuer?: string;
|
|
740
|
+
};
|
|
741
|
+
declare type StellarCreateAccountOperation = {
|
|
742
|
+
type: 'createAccount';
|
|
743
|
+
source?: string;
|
|
744
|
+
destination: string;
|
|
745
|
+
startingBalance: string;
|
|
746
|
+
};
|
|
747
|
+
declare type StellarPaymentOperation = {
|
|
748
|
+
type: 'payment';
|
|
749
|
+
source?: string;
|
|
750
|
+
destination: string;
|
|
751
|
+
asset?: StellarAsset | typeof undefined;
|
|
752
|
+
amount: string;
|
|
753
|
+
};
|
|
754
|
+
declare type StellarPathPaymentOperation = {
|
|
755
|
+
type: 'pathPayment';
|
|
756
|
+
source?: string;
|
|
757
|
+
sendAsset: StellarAsset;
|
|
758
|
+
sendMax: string;
|
|
759
|
+
destination: string;
|
|
760
|
+
destAsset: StellarAsset;
|
|
761
|
+
destAmount: string;
|
|
762
|
+
path?: StellarAsset[];
|
|
763
|
+
};
|
|
764
|
+
declare type StellarPassiveOfferOperation = {
|
|
765
|
+
type: 'createPassiveOffer';
|
|
766
|
+
source?: string;
|
|
767
|
+
buying: StellarAsset;
|
|
768
|
+
selling: StellarAsset;
|
|
769
|
+
amount: string;
|
|
770
|
+
price: {
|
|
771
|
+
n: number;
|
|
772
|
+
d: number;
|
|
773
|
+
};
|
|
774
|
+
};
|
|
775
|
+
declare type StellarManageOfferOperation = {
|
|
776
|
+
type: 'manageOffer';
|
|
777
|
+
source?: string;
|
|
778
|
+
buying: StellarAsset;
|
|
779
|
+
selling: StellarAsset;
|
|
780
|
+
amount: string;
|
|
781
|
+
offerId?: string;
|
|
782
|
+
price: {
|
|
783
|
+
n: number;
|
|
784
|
+
d: number;
|
|
785
|
+
};
|
|
786
|
+
};
|
|
787
|
+
declare type StellarSetOptionsOperation = {
|
|
788
|
+
type: 'setOptions';
|
|
789
|
+
source?: string;
|
|
790
|
+
signer?: {
|
|
791
|
+
type: 0 | 1 | 2;
|
|
792
|
+
key: string | Buffer;
|
|
793
|
+
weight?: number;
|
|
794
|
+
};
|
|
795
|
+
inflationDest?: string;
|
|
796
|
+
clearFlags?: number;
|
|
797
|
+
setFlags?: number;
|
|
798
|
+
masterWeight?: number | string;
|
|
799
|
+
lowThreshold?: number | string;
|
|
800
|
+
medThreshold?: number | string;
|
|
801
|
+
highThreshold?: number | string;
|
|
802
|
+
homeDomain?: string;
|
|
803
|
+
};
|
|
804
|
+
declare type StellarChangeTrustOperation = {
|
|
805
|
+
type: 'changeTrust';
|
|
806
|
+
source?: string;
|
|
807
|
+
line: StellarAsset;
|
|
808
|
+
limit?: string;
|
|
809
|
+
};
|
|
810
|
+
declare type StellarAllowTrustOperation = {
|
|
811
|
+
type: 'allowTrust';
|
|
812
|
+
source?: string;
|
|
813
|
+
trustor: string;
|
|
814
|
+
assetCode: string;
|
|
815
|
+
assetType: number;
|
|
816
|
+
authorize?: boolean | typeof undefined;
|
|
817
|
+
};
|
|
818
|
+
declare type StellarAccountMergeOperation = {
|
|
819
|
+
type: 'accountMerge';
|
|
820
|
+
source?: string;
|
|
821
|
+
destination: string;
|
|
822
|
+
};
|
|
823
|
+
declare type StellarManageDataOperation = {
|
|
824
|
+
type: 'manageData';
|
|
825
|
+
source?: string;
|
|
826
|
+
name: string;
|
|
827
|
+
value?: Buffer | string;
|
|
828
|
+
};
|
|
829
|
+
declare type StellarBumpSequenceOperation = {
|
|
830
|
+
type: 'bumpSequence';
|
|
831
|
+
source?: string;
|
|
832
|
+
bumpTo: string;
|
|
833
|
+
};
|
|
834
|
+
declare type StellarInflationOperation = {
|
|
835
|
+
type: 'inflation';
|
|
836
|
+
source?: string;
|
|
837
|
+
};
|
|
838
|
+
declare type StellarOperation = StellarCreateAccountOperation | StellarPaymentOperation | StellarPathPaymentOperation | StellarPassiveOfferOperation | StellarManageOfferOperation | StellarSetOptionsOperation | StellarChangeTrustOperation | StellarAllowTrustOperation | StellarAccountMergeOperation | StellarInflationOperation | StellarManageDataOperation | StellarBumpSequenceOperation;
|
|
839
|
+
declare type StellarTransaction = {
|
|
840
|
+
source: string;
|
|
841
|
+
fee: number;
|
|
842
|
+
sequence: string | number;
|
|
843
|
+
timebounds?: {
|
|
844
|
+
minTime: number;
|
|
845
|
+
maxTime: number;
|
|
846
|
+
};
|
|
847
|
+
memo?: {
|
|
848
|
+
type: 0 | 1 | 2 | 3 | 4;
|
|
849
|
+
id?: string;
|
|
850
|
+
text?: string;
|
|
851
|
+
hash?: string | Buffer;
|
|
852
|
+
};
|
|
853
|
+
operations: StellarOperation[];
|
|
854
|
+
};
|
|
855
|
+
declare type StellarSignTransactionParams = {
|
|
856
|
+
path: string | number[];
|
|
857
|
+
networkPassphrase: string;
|
|
858
|
+
transaction: StellarTransaction;
|
|
859
|
+
};
|
|
860
|
+
declare function stellarSignTransaction(connectId: string, params: CommonParams & StellarSignTransactionParams): Response<StellarSignedTx>;
|
|
861
|
+
|
|
862
|
+
declare type CipheredKeyValue = {
|
|
863
|
+
path: string;
|
|
864
|
+
} & CipheredKeyValue$1;
|
|
865
|
+
declare type CipheredKeyValueParams = {
|
|
866
|
+
path: string | number[];
|
|
867
|
+
key: string;
|
|
868
|
+
value: string;
|
|
869
|
+
encrypt?: boolean;
|
|
870
|
+
askOnEncrypt?: boolean;
|
|
871
|
+
askOnDecrypt?: boolean;
|
|
872
|
+
iv?: string;
|
|
873
|
+
};
|
|
874
|
+
declare function cipherKeyValue(connectId: string, params: CommonParams & CipheredKeyValueParams): Response<CipheredKeyValue>;
|
|
875
|
+
declare function cipherKeyValue(connectId: string, params: CommonParams & {
|
|
876
|
+
bundle?: CipheredKeyValueParams[];
|
|
877
|
+
}): Response<Array<CipheredKeyValue>>;
|
|
878
|
+
|
|
879
|
+
interface FirmwareUpdateBinary {
|
|
880
|
+
binary: ArrayBuffer;
|
|
881
|
+
}
|
|
882
|
+
interface FirmwareUpdate {
|
|
883
|
+
version: number[];
|
|
884
|
+
btcOnly?: boolean;
|
|
885
|
+
updateType: 'firmware' | 'ble';
|
|
886
|
+
}
|
|
887
|
+
declare function firmwareUpdate(connectId: string | undefined, params: Params<FirmwareUpdate>): Response<Messages.Success>;
|
|
888
|
+
declare function firmwareUpdate(connectId: string | undefined, params: Params<FirmwareUpdateBinary>): Response<Messages.Success>;
|
|
889
|
+
|
|
548
890
|
declare type CoreApi = {
|
|
549
891
|
init: typeof init$1;
|
|
550
892
|
on: typeof on;
|
|
@@ -559,6 +901,7 @@ declare type CoreApi = {
|
|
|
559
901
|
checkFirmwareRelease: typeof checkFirmwareRelease;
|
|
560
902
|
checkBLEFirmwareRelease: typeof checkBLEFirmwareRelease;
|
|
561
903
|
checkTransportRelease: typeof checkTransportRelease;
|
|
904
|
+
cipherKeyValue: typeof cipherKeyValue;
|
|
562
905
|
deviceBackup: typeof deviceBackup;
|
|
563
906
|
deviceChangePin: typeof deviceChangePin;
|
|
564
907
|
deviceFlags: typeof deviceFlags;
|
|
@@ -585,6 +928,13 @@ declare type CoreApi = {
|
|
|
585
928
|
starcoinSignMessage: typeof starcoinSignMessage;
|
|
586
929
|
starcoinSignTransaction: typeof starcoinSignTransaction;
|
|
587
930
|
starcoinVerifyMessage: typeof starcoinVerifyMessage;
|
|
931
|
+
nemGetAddress: typeof nemGetAddress;
|
|
932
|
+
nemSignTransaction: typeof nemSignTransaction;
|
|
933
|
+
solGetAddress: typeof solGetAddress;
|
|
934
|
+
solSignTransaction: typeof solSignTransaction;
|
|
935
|
+
stellarGetAddress: typeof stellarGetAddress;
|
|
936
|
+
stellarSignTransaction: typeof stellarSignTransaction;
|
|
937
|
+
firmwareUpdate: typeof firmwareUpdate;
|
|
588
938
|
};
|
|
589
939
|
|
|
590
940
|
declare type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
@@ -645,6 +995,7 @@ declare const UI_REQUEST: {
|
|
|
645
995
|
readonly CLOSE_UI_WINDOW: "ui-close_window";
|
|
646
996
|
readonly BLUETOOTH_PERMISSION: "ui-bluetooth_permission";
|
|
647
997
|
readonly LOCATION_PERMISSION: "ui-location_permission";
|
|
998
|
+
readonly FIRMWARE_PROGRESS: "ui-firmware-progress";
|
|
648
999
|
};
|
|
649
1000
|
interface UiRequestWithoutPayload {
|
|
650
1001
|
type: typeof UI_REQUEST.CLOSE_UI_WINDOW | typeof UI_REQUEST.BLUETOOTH_PERMISSION | typeof UI_REQUEST.LOCATION_PERMISSION;
|
|
@@ -661,7 +1012,14 @@ interface UiRequestButton {
|
|
|
661
1012
|
type: typeof UI_REQUEST.REQUEST_BUTTON;
|
|
662
1013
|
payload: DeviceButtonRequest['payload'];
|
|
663
1014
|
}
|
|
664
|
-
|
|
1015
|
+
interface FirmwareProgress {
|
|
1016
|
+
type: typeof UI_REQUEST.FIRMWARE_PROGRESS;
|
|
1017
|
+
payload: {
|
|
1018
|
+
device: Device$1;
|
|
1019
|
+
progress: number;
|
|
1020
|
+
};
|
|
1021
|
+
}
|
|
1022
|
+
declare type UiEvent = UiRequestWithoutPayload | UiRequestDeviceAction | UiRequestButton | FirmwareProgress;
|
|
665
1023
|
declare type UiEventMessage = UiEvent & {
|
|
666
1024
|
event: typeof UI_EVENT;
|
|
667
1025
|
};
|
|
@@ -825,7 +1183,7 @@ declare class Log {
|
|
|
825
1183
|
declare const initLog: (prefix: string, enabled?: boolean | undefined) => Log;
|
|
826
1184
|
declare const enableLog: (enabled?: boolean | undefined) => void;
|
|
827
1185
|
|
|
828
|
-
declare const httpRequest: (url: string,
|
|
1186
|
+
declare const httpRequest: (url: string, type: string) => any;
|
|
829
1187
|
declare const getTimeStamp: () => number;
|
|
830
1188
|
|
|
831
1189
|
declare const isValidVersionString: (version: string) => boolean;
|
|
@@ -932,6 +1290,7 @@ declare class Device extends EventEmitter {
|
|
|
932
1290
|
connect(): Promise<boolean>;
|
|
933
1291
|
acquire(): Promise<void>;
|
|
934
1292
|
release(): Promise<void>;
|
|
1293
|
+
getCommands(): DeviceCommands;
|
|
935
1294
|
getInternalState(): string;
|
|
936
1295
|
initialize(): Promise<void>;
|
|
937
1296
|
getFeatures(): Promise<void>;
|
|
@@ -1001,4 +1360,4 @@ declare class DataManager {
|
|
|
1001
1360
|
|
|
1002
1361
|
declare const HardwareSdk: ({ init, call, dispose, eventEmitter, uiResponse, cancel, }: InjectApi) => CoreApi;
|
|
1003
1362
|
|
|
1004
|
-
export { AccountAddress, AccountAddresses, AssetsMap, BTCAddress, BTCGetAddressParams, BTCGetPublicKeyParams, BTCPublicKey, BTCSignMessageParams, BTCSignTransactionParams, BTCVerifyMessageParams, CORE_EVENT, CallMethod, CallMethodAnyResponse, CallMethodKeys, CallMethodPayload, CallMethodResponse, CallMethodUnion, CommonParams, ConnectSettings, Core, CoreApi, CoreMessage, DEFAULT_PRIORITY, DEVICE, DEVICE_EVENT, DataManager, Deferred, Device$1 as Device, DeviceButtonRequest, DeviceButtonRequestPayload, DeviceChangePinParams, DeviceEvent, DeviceEventListenerFn, DeviceEventMessage, DeviceFlagsParams, DeviceMode, DeviceRecoveryParams, DeviceResetParams, DeviceSettingsParams, DeviceStatus, DeviceTypeMap, errors as ERRORS, EVMAccessList, EVMAddress, EVMGetAddressParams, EVMGetPublicKeyParams, EVMPublicKey, EVMSignMessageEIP712Params, EVMSignMessageParams, EVMSignTransactionParams, EVMSignTypedDataParams, EVMSignedTx, EVMTransaction, EVMTransactionEIP1559, EVMVerifyMessageParams, EthereumSignTypedDataMessage, EthereumSignTypedDataTypeProperty, EthereumSignTypedDataTypes, Features, FirmwareRange, FirmwareRelease, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceType, IFRAME, IFirmwareReleaseInfo, IFrameBridge, IFrameCallMessage, IFrameEvent, IFrameEventMessage, IFrameInit, ILocale, ITransportStatus, IVersionArray, KnownDevice, MethodResponseMessage, PostMessageEvent, RESPONSE_EVENT, RefTransaction, ReleaseInfo, RemoteConfigResponse, Response, SearchDevice, SignedTransaction, StarcoinAddress, StarcoinGetAddressParams, StarcoinGetPublicKeyParams, StarcoinPublicKey, StarcoinSignMessageParams, StarcoinSignTransactionParams, StarcoinVerifyMessageParams, Success, TransactionOptions, TransportReleaseStatus, UI_EVENT, UI_REQUEST, UI_RESPONSE, UiEvent, UiEventMessage, UiPromise, UiPromiseResponse, UiRequestButton, UiRequestDeviceAction, UiRequestWithoutPayload, UiResponseEvent, UiResponseMessage, UiResponsePin, UnavailableCapabilities, UnavailableCapability, Unsuccessful, VersionArray, corsValidator, create, createDeviceMessage, createErrorMessage, createIFrameMessage, createResponseMessage, createUiMessage, createUiResponse, HardwareSdk as default, enableLog, getDeviceLabel, getDeviceType, getDeviceTypeByBleName, getDeviceTypeByDeviceId, getDeviceUUID, getEnv, getHDPath, getScriptType, getTimeStamp, httpRequest, init as initCore, initLog, isValidVersionArray, isValidVersionString, normalizeVersionArray, parseConnectSettings, parseMessage, versionCompare, versionSplit };
|
|
1363
|
+
export { AccountAddress, AccountAddresses, AssetsMap, BTCAddress, BTCGetAddressParams, BTCGetPublicKeyParams, BTCPublicKey, BTCSignMessageParams, BTCSignTransactionParams, BTCVerifyMessageParams, CORE_EVENT, CallMethod, CallMethodAnyResponse, CallMethodKeys, CallMethodPayload, CallMethodResponse, CallMethodUnion, CipheredKeyValue, CipheredKeyValueParams, CommonParams, ConnectSettings, Core, CoreApi, CoreMessage, DEFAULT_PRIORITY, DEVICE, DEVICE_EVENT, DataManager, Deferred, Device$1 as Device, DeviceButtonRequest, DeviceButtonRequestPayload, DeviceChangePinParams, DeviceEvent, DeviceEventListenerFn, DeviceEventMessage, DeviceFirmwareRange, DeviceFlagsParams, DeviceMode, DeviceRecoveryParams, DeviceResetParams, DeviceSettingsParams, DeviceStatus, DeviceTypeMap, errors as ERRORS, EVMAccessList, EVMAddress, EVMGetAddressParams, EVMGetPublicKeyParams, EVMPublicKey, EVMSignMessageEIP712Params, EVMSignMessageParams, EVMSignTransactionParams, EVMSignTypedDataParams, EVMSignedTx, EVMTransaction, EVMTransactionEIP1559, EVMVerifyMessageParams, EthereumSignTypedDataMessage, EthereumSignTypedDataTypeProperty, EthereumSignTypedDataTypes, Features, FirmwareProgress, FirmwareRange, FirmwareRelease, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceModel, IDeviceType, IFRAME, IFirmwareReleaseInfo, IFrameBridge, IFrameCallMessage, IFrameEvent, IFrameEventMessage, IFrameInit, ILocale, ITransportStatus, IVersionArray, KnownDevice, MajorVersion, MethodResponseMessage, NEMAddress, NEMAggregateModificationTransaction, NEMGetAddressParams, NEMImportanceTransaction, NEMMosaic, NEMMosaicCreationTransaction, NEMMultisigTransaction, NEMProvisionNamespaceTransaction, NEMSignTransactionParams, NEMSupplyChangeTransaction, NEMTransaction, NEMTransferTransaction, Params, PostMessageEvent, RESPONSE_EVENT, RefTransaction, ReleaseInfo, RemoteConfigResponse, Response, SearchDevice, SignedTransaction, SolanaAddress, SolanaGetAddressParams, SolanaSignTransactionParams, SolanaSignedTx, StarcoinAddress, StarcoinGetAddressParams, StarcoinGetPublicKeyParams, StarcoinPublicKey, StarcoinSignMessageParams, StarcoinSignTransactionParams, StarcoinVerifyMessageParams, StellarAddress, StellarAsset, StellarGetAddressParams, StellarOperation, StellarSignTransactionParams, StellarTransaction, StrictFeatures, Success, TransactionOptions, TransportReleaseStatus, UI_EVENT, UI_REQUEST, UI_RESPONSE, UiEvent, UiEventMessage, UiPromise, UiPromiseResponse, UiRequestButton, UiRequestDeviceAction, UiRequestWithoutPayload, UiResponseEvent, UiResponseMessage, UiResponsePin, UnavailableCapabilities, UnavailableCapability, Unsuccessful, VersionArray, corsValidator, create, createDeviceMessage, createErrorMessage, createIFrameMessage, createResponseMessage, createUiMessage, createUiResponse, HardwareSdk as default, enableLog, getDeviceLabel, getDeviceType, getDeviceTypeByBleName, getDeviceTypeByDeviceId, getDeviceUUID, getEnv, getHDPath, getScriptType, getTimeStamp, httpRequest, init as initCore, initLog, isValidVersionArray, isValidVersionString, normalizeVersionArray, parseConnectSettings, parseMessage, versionCompare, versionSplit };
|