@onekeyfe/hd-core 1.1.26-alpha.8 → 1.1.26-alpha.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.
@@ -11569,6 +11569,102 @@
11569
11569
  }
11570
11570
  }
11571
11571
  },
11572
+ "TonSignData": {
11573
+ "fields": {
11574
+ "address_n": {
11575
+ "rule": "repeated",
11576
+ "type": "uint32",
11577
+ "id": 1,
11578
+ "options": {
11579
+ "packed": false
11580
+ }
11581
+ },
11582
+ "type": {
11583
+ "rule": "required",
11584
+ "type": "TonSignDataType",
11585
+ "id": 2
11586
+ },
11587
+ "payload": {
11588
+ "rule": "required",
11589
+ "type": "bytes",
11590
+ "id": 3
11591
+ },
11592
+ "schema": {
11593
+ "type": "string",
11594
+ "id": 4
11595
+ },
11596
+ "appdomain": {
11597
+ "rule": "required",
11598
+ "type": "string",
11599
+ "id": 5
11600
+ },
11601
+ "timestamp": {
11602
+ "rule": "required",
11603
+ "type": "uint64",
11604
+ "id": 6
11605
+ },
11606
+ "from_address": {
11607
+ "type": "string",
11608
+ "id": 7
11609
+ },
11610
+ "wallet_version": {
11611
+ "type": "TonWalletVersion",
11612
+ "id": 8,
11613
+ "options": {
11614
+ "default": "V4R2"
11615
+ }
11616
+ },
11617
+ "wallet_id": {
11618
+ "type": "uint32",
11619
+ "id": 9,
11620
+ "options": {
11621
+ "default": 698983191
11622
+ }
11623
+ },
11624
+ "workchain": {
11625
+ "type": "TonWorkChain",
11626
+ "id": 10,
11627
+ "options": {
11628
+ "default": "BASECHAIN"
11629
+ }
11630
+ },
11631
+ "is_bounceable": {
11632
+ "type": "bool",
11633
+ "id": 11,
11634
+ "options": {
11635
+ "default": false
11636
+ }
11637
+ },
11638
+ "is_testnet_only": {
11639
+ "type": "bool",
11640
+ "id": 12,
11641
+ "options": {
11642
+ "default": false
11643
+ }
11644
+ }
11645
+ },
11646
+ "nested": {
11647
+ "TonSignDataType": {
11648
+ "values": {
11649
+ "TEXT": 0,
11650
+ "BINARY": 1,
11651
+ "CELL": 2
11652
+ }
11653
+ }
11654
+ }
11655
+ },
11656
+ "TonSignedData": {
11657
+ "fields": {
11658
+ "signature": {
11659
+ "type": "bytes",
11660
+ "id": 1
11661
+ },
11662
+ "digest": {
11663
+ "type": "bytes",
11664
+ "id": 2
11665
+ }
11666
+ }
11667
+ },
11572
11668
  "TronGetAddress": {
11573
11669
  "fields": {
11574
11670
  "address_n": {
@@ -12501,6 +12597,8 @@
12501
12597
  "MessageType_TonSignProof": 11905,
12502
12598
  "MessageType_TonSignedProof": 11906,
12503
12599
  "MessageType_TonTxAck": 11907,
12600
+ "MessageType_TonSignData": 11908,
12601
+ "MessageType_TonSignedData": 11909,
12504
12602
  "MessageType_ScdoGetAddress": 12001,
12505
12603
  "MessageType_ScdoAddress": 12002,
12506
12604
  "MessageType_ScdoSignTx": 12003,
@@ -400,6 +400,10 @@ export class DeviceCommands {
400
400
  error = ERRORS.TypedError(HardwareErrorCode.PinCancelled);
401
401
  }
402
402
 
403
+ if (code === 'Failure_PinMismatch') {
404
+ error = ERRORS.TypedError(HardwareErrorCode.PinMismatch, message);
405
+ }
406
+
403
407
  if (code === 'Failure_DataError') {
404
408
  if (message === 'Please confirm the BlindSign enabled') {
405
409
  error = ERRORS.TypedError(HardwareErrorCode.BlindSignDisabled);
package/src/inject.ts CHANGED
@@ -377,6 +377,8 @@ export const createCoreApi = (
377
377
  call({ ...params, connectId, deviceId, method: 'tonSignMessage' }),
378
378
  tonSignProof: (connectId, deviceId, params) =>
379
379
  call({ ...params, connectId, deviceId, method: 'tonSignProof' }),
380
+ tonSignData: (connectId, deviceId, params) =>
381
+ call({ ...params, connectId, deviceId, method: 'tonSignData' }),
380
382
 
381
383
  scdoGetAddress: (connectId, deviceId, params) =>
382
384
  call({ ...params, connectId, deviceId, method: 'scdoGetAddress' }),
@@ -179,6 +179,7 @@ export type { DnxTxKey, DnxSignTransactionParams, DnxSignature } from './dnxSign
179
179
  export type { TonAddress, TonGetAddressParams } from './tonGetAddress';
180
180
  export type { TonSignMessageParams } from './tonSignMessage';
181
181
  export type { TonSignProofParams } from './tonSignProof';
182
+ export type { TonSignDataParams } from './tonSignData';
182
183
 
183
184
  export type { ScdoAddress, ScdoGetAddressParams } from './scdoGetAddress';
184
185
  export type { ScdoSignMessageParams } from './scdoSignMessage';
@@ -114,6 +114,7 @@ import type { dnxSignTransaction } from './dnxSignTransaction';
114
114
  import type { tonGetAddress } from './tonGetAddress';
115
115
  import type { tonSignMessage } from './tonSignMessage';
116
116
  import type { tonSignProof } from './tonSignProof';
117
+ import type { tonSignData } from './tonSignData';
117
118
  import type { scdoGetAddress } from './scdoGetAddress';
118
119
  import type { scdoSignMessage } from './scdoSignMessage';
119
120
  import type { scdoSignTransaction } from './scdoSignTransaction';
@@ -373,6 +374,7 @@ export type CoreApi = {
373
374
  tonGetAddress: typeof tonGetAddress;
374
375
  tonSignMessage: typeof tonSignMessage;
375
376
  tonSignProof: typeof tonSignProof;
377
+ tonSignData: typeof tonSignData;
376
378
 
377
379
  /**
378
380
  * SCDO Network
@@ -0,0 +1,29 @@
1
+ import type {
2
+ TonSignDataType,
3
+ TonSignedData,
4
+ TonWalletVersion,
5
+ TonWorkChain,
6
+ UintType,
7
+ } from '@onekeyfe/hd-transport';
8
+ import type { CommonParams, Response } from '../params';
9
+
10
+ export type TonSignDataParams = {
11
+ path: string | number[];
12
+ type: TonSignDataType;
13
+ payload: string;
14
+ schema?: string;
15
+ appdomain: string;
16
+ timestamp: UintType;
17
+ fromAddress?: string;
18
+ walletVersion?: TonWalletVersion;
19
+ walletId?: number;
20
+ workchain?: TonWorkChain;
21
+ isBounceable?: boolean;
22
+ isTestnetOnly?: boolean;
23
+ };
24
+
25
+ export declare function tonSignData(
26
+ connectId: string,
27
+ deviceId: string,
28
+ params: CommonParams & TonSignDataParams
29
+ ): Response<TonSignedData>;