@onekeyfe/hd-core 1.0.10-alpha.8 → 1.0.10-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.
- package/dist/api/scdo/ScdoSignTransaction.d.ts.map +1 -1
- package/dist/api/ton/TonSignMessage.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +23 -13
- package/dist/types/api/tonSignMessage.d.ts +1 -0
- package/dist/types/api/tonSignMessage.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/scdo/ScdoSignTransaction.ts +3 -2
- package/src/api/ton/TonSignMessage.ts +2 -0
- package/src/data/messages/messages.json +18 -11
- package/src/types/api/tonSignMessage.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScdoSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/api/scdo/ScdoSignTransaction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,IAAI,kBAAkB,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAInG,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGxE,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,UAAU,CAAC,kBAAkB,CAAC;IAC7E,IAAI;IAmCJ,eAAe;;;;;;;;IAWf,aAAa,SAAQ;IAErB,gBAAgB,cACH,SAAS,OACf,qBAAqB,cAAc,CAAC,QACnC,MAAM,sBAEX,QAAQ,YAAY,CAAC,CAmBtB;IAEI,GAAG;
|
|
1
|
+
{"version":3,"file":"ScdoSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/api/scdo/ScdoSignTransaction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,IAAI,kBAAkB,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAInG,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGxE,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,UAAU,CAAC,kBAAkB,CAAC;IAC7E,IAAI;IAmCJ,eAAe;;;;;;;;IAWf,aAAa,SAAQ;IAErB,gBAAgB,cACH,SAAS,OACf,qBAAqB,cAAc,CAAC,QACnC,MAAM,sBAEX,QAAQ,YAAY,CAAC,CAmBtB;IAEI,GAAG;CAiBV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TonSignMessage.d.ts","sourceRoot":"","sources":["../../../src/api/ton/TonSignMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAIlF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CAAC,sBAAsB,CAAC;IAC5E,IAAI;
|
|
1
|
+
{"version":3,"file":"TonSignMessage.d.ts","sourceRoot":"","sources":["../../../src/api/ton/TonSignMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAIlF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CAAC,sBAAsB,CAAC;IAC5E,IAAI;IAuDJ,eAAe;;;;;;;;;;;IAcT,GAAG;CAOV"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -11686,9 +11686,16 @@ var nested$1 = {
|
|
|
11686
11686
|
type: "string",
|
|
11687
11687
|
id: 8
|
|
11688
11688
|
},
|
|
11689
|
+
is_raw_data: {
|
|
11690
|
+
type: "bool",
|
|
11691
|
+
id: 9,
|
|
11692
|
+
options: {
|
|
11693
|
+
"default": false
|
|
11694
|
+
}
|
|
11695
|
+
},
|
|
11689
11696
|
mode: {
|
|
11690
11697
|
type: "uint32",
|
|
11691
|
-
id:
|
|
11698
|
+
id: 10,
|
|
11692
11699
|
options: {
|
|
11693
11700
|
"default": 3
|
|
11694
11701
|
}
|
|
@@ -11696,44 +11703,44 @@ var nested$1 = {
|
|
|
11696
11703
|
seqno: {
|
|
11697
11704
|
rule: "required",
|
|
11698
11705
|
type: "uint32",
|
|
11699
|
-
id:
|
|
11706
|
+
id: 11
|
|
11700
11707
|
},
|
|
11701
11708
|
expire_at: {
|
|
11702
11709
|
rule: "required",
|
|
11703
11710
|
type: "uint64",
|
|
11704
|
-
id:
|
|
11711
|
+
id: 12
|
|
11705
11712
|
},
|
|
11706
11713
|
wallet_version: {
|
|
11707
11714
|
type: "TonWalletVersion",
|
|
11708
|
-
id:
|
|
11715
|
+
id: 13,
|
|
11709
11716
|
options: {
|
|
11710
11717
|
"default": "V4R2"
|
|
11711
11718
|
}
|
|
11712
11719
|
},
|
|
11713
11720
|
wallet_id: {
|
|
11714
11721
|
type: "uint32",
|
|
11715
|
-
id:
|
|
11722
|
+
id: 14,
|
|
11716
11723
|
options: {
|
|
11717
11724
|
"default": 698983191
|
|
11718
11725
|
}
|
|
11719
11726
|
},
|
|
11720
11727
|
workchain: {
|
|
11721
11728
|
type: "TonWorkChain",
|
|
11722
|
-
id:
|
|
11729
|
+
id: 15,
|
|
11723
11730
|
options: {
|
|
11724
11731
|
"default": "BASECHAIN"
|
|
11725
11732
|
}
|
|
11726
11733
|
},
|
|
11727
11734
|
is_bounceable: {
|
|
11728
11735
|
type: "bool",
|
|
11729
|
-
id:
|
|
11736
|
+
id: 16,
|
|
11730
11737
|
options: {
|
|
11731
11738
|
"default": false
|
|
11732
11739
|
}
|
|
11733
11740
|
},
|
|
11734
11741
|
is_testnet_only: {
|
|
11735
11742
|
type: "bool",
|
|
11736
|
-
id:
|
|
11743
|
+
id: 17,
|
|
11737
11744
|
options: {
|
|
11738
11745
|
"default": false
|
|
11739
11746
|
}
|
|
@@ -11741,12 +11748,12 @@ var nested$1 = {
|
|
|
11741
11748
|
ext_destination: {
|
|
11742
11749
|
rule: "repeated",
|
|
11743
11750
|
type: "string",
|
|
11744
|
-
id:
|
|
11751
|
+
id: 18
|
|
11745
11752
|
},
|
|
11746
11753
|
ext_ton_amount: {
|
|
11747
11754
|
rule: "repeated",
|
|
11748
11755
|
type: "uint64",
|
|
11749
|
-
id:
|
|
11756
|
+
id: 19,
|
|
11750
11757
|
options: {
|
|
11751
11758
|
packed: false
|
|
11752
11759
|
}
|
|
@@ -11754,7 +11761,7 @@ var nested$1 = {
|
|
|
11754
11761
|
ext_payload: {
|
|
11755
11762
|
rule: "repeated",
|
|
11756
11763
|
type: "string",
|
|
11757
|
-
id:
|
|
11764
|
+
id: 20
|
|
11758
11765
|
}
|
|
11759
11766
|
}
|
|
11760
11767
|
},
|
|
@@ -34625,6 +34632,7 @@ class TonSignMessage extends BaseMethod {
|
|
|
34625
34632
|
{ name: 'jettonAmount', type: 'number' },
|
|
34626
34633
|
{ name: 'fwdFee', type: 'number' },
|
|
34627
34634
|
{ name: 'comment', type: 'string' },
|
|
34635
|
+
{ name: 'isRawData', type: 'boolean' },
|
|
34628
34636
|
{ name: 'mode', type: 'number' },
|
|
34629
34637
|
{ name: 'seqno', type: 'number' },
|
|
34630
34638
|
{ name: 'expireAt', type: 'number' },
|
|
@@ -34649,6 +34657,7 @@ class TonSignMessage extends BaseMethod {
|
|
|
34649
34657
|
fwd_fee: this.payload.fwdFee,
|
|
34650
34658
|
comment: this.payload.comment,
|
|
34651
34659
|
mode: this.payload.mode,
|
|
34660
|
+
is_raw_data: this.payload.isRawData,
|
|
34652
34661
|
seqno: this.payload.seqno,
|
|
34653
34662
|
expire_at: this.payload.expireAt,
|
|
34654
34663
|
wallet_version: this.payload.walletVersion,
|
|
@@ -34820,7 +34829,7 @@ class ScdoSignTransaction extends BaseMethod {
|
|
|
34820
34829
|
{ name: 'to', required: true, type: 'string' },
|
|
34821
34830
|
{ name: 'value', required: true, type: 'string' },
|
|
34822
34831
|
{ name: 'timestamp', type: 'string' },
|
|
34823
|
-
{ name: 'data', type: '
|
|
34832
|
+
{ name: 'data', type: 'hexString' },
|
|
34824
34833
|
{ name: 'txType', type: 'number' },
|
|
34825
34834
|
]);
|
|
34826
34835
|
const { path, nonce, gasPrice, gasLimit, to, value, timestamp, txType } = this
|
|
@@ -34851,7 +34860,8 @@ class ScdoSignTransaction extends BaseMethod {
|
|
|
34851
34860
|
var _a;
|
|
34852
34861
|
return __awaiter(this, void 0, void 0, function* () {
|
|
34853
34862
|
const typedCall = this.device.getCommands().typedCall.bind(this.device.getCommands());
|
|
34854
|
-
const
|
|
34863
|
+
const rawData = (_a = this.payload) === null || _a === void 0 ? void 0 : _a.data;
|
|
34864
|
+
const data = rawData && Buffer.from(stripHexStartZeroes(formatAnyHex(rawData)), 'hex');
|
|
34855
34865
|
const offset = this.chunkByteSize;
|
|
34856
34866
|
if (data && data.length > 0) {
|
|
34857
34867
|
this.params.data_initial_chunk = utils.bytesToHex(data.subarray(0, this.chunkByteSize));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tonSignMessage.d.ts","sourceRoot":"","sources":["../../../src/types/api/tonSignMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC1F,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAExD,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC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AE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,YAAY,GAAG,oBAAoB,GAC1C,QAAQ,CAAC,gBAAgB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-core",
|
|
3
|
-
"version": "1.0.10-alpha.
|
|
3
|
+
"version": "1.0.10-alpha.9",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "OneKey",
|
|
6
6
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@onekeyfe/hd-shared": "^1.0.10-alpha.
|
|
29
|
-
"@onekeyfe/hd-transport": "^1.0.10-alpha.
|
|
28
|
+
"@onekeyfe/hd-shared": "^1.0.10-alpha.9",
|
|
29
|
+
"@onekeyfe/hd-transport": "^1.0.10-alpha.9",
|
|
30
30
|
"axios": "^0.27.2",
|
|
31
31
|
"bignumber.js": "^9.0.2",
|
|
32
32
|
"bytebuffer": "^5.0.1",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"@types/semver": "^7.3.9",
|
|
45
45
|
"ripple-keypairs": "^1.1.4"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "822d59c4ccdec23b672535a5f746df7bbda43eb0"
|
|
48
48
|
}
|
|
@@ -22,7 +22,7 @@ export default class ScdoSignTransaction extends BaseMethod<HardwareScdoSignTx>
|
|
|
22
22
|
{ name: 'to', required: true, type: 'string' },
|
|
23
23
|
{ name: 'value', required: true, type: 'string' },
|
|
24
24
|
{ name: 'timestamp', type: 'string' },
|
|
25
|
-
{ name: 'data', type: '
|
|
25
|
+
{ name: 'data', type: 'hexString' },
|
|
26
26
|
{ name: 'txType', type: 'number' },
|
|
27
27
|
]);
|
|
28
28
|
|
|
@@ -86,7 +86,8 @@ export default class ScdoSignTransaction extends BaseMethod<HardwareScdoSignTx>
|
|
|
86
86
|
async run() {
|
|
87
87
|
const typedCall = this.device.getCommands().typedCall.bind(this.device.getCommands());
|
|
88
88
|
|
|
89
|
-
const
|
|
89
|
+
const rawData = this.payload?.data;
|
|
90
|
+
const data = rawData && Buffer.from(stripHexStartZeroes(formatAnyHex(rawData)), 'hex');
|
|
90
91
|
const offset = this.chunkByteSize;
|
|
91
92
|
if (data && data.length > 0) {
|
|
92
93
|
this.params.data_initial_chunk = bytesToHex(data.subarray(0, this.chunkByteSize));
|
|
@@ -21,6 +21,7 @@ export default class TonSignMessage extends BaseMethod<HardwareTonSignMessage> {
|
|
|
21
21
|
{ name: 'jettonAmount', type: 'number' },
|
|
22
22
|
{ name: 'fwdFee', type: 'number' },
|
|
23
23
|
{ name: 'comment', type: 'string' },
|
|
24
|
+
{ name: 'isRawData', type: 'boolean' },
|
|
24
25
|
{ name: 'mode', type: 'number' },
|
|
25
26
|
{ name: 'seqno', type: 'number' },
|
|
26
27
|
{ name: 'expireAt', type: 'number' },
|
|
@@ -47,6 +48,7 @@ export default class TonSignMessage extends BaseMethod<HardwareTonSignMessage> {
|
|
|
47
48
|
fwd_fee: this.payload.fwdFee,
|
|
48
49
|
comment: this.payload.comment,
|
|
49
50
|
mode: this.payload.mode,
|
|
51
|
+
is_raw_data: this.payload.isRawData,
|
|
50
52
|
seqno: this.payload.seqno,
|
|
51
53
|
expire_at: this.payload.expireAt,
|
|
52
54
|
wallet_version: this.payload.walletVersion,
|
|
@@ -10532,9 +10532,16 @@
|
|
|
10532
10532
|
"type": "string",
|
|
10533
10533
|
"id": 8
|
|
10534
10534
|
},
|
|
10535
|
+
"is_raw_data": {
|
|
10536
|
+
"type": "bool",
|
|
10537
|
+
"id": 9,
|
|
10538
|
+
"options": {
|
|
10539
|
+
"default": false
|
|
10540
|
+
}
|
|
10541
|
+
},
|
|
10535
10542
|
"mode": {
|
|
10536
10543
|
"type": "uint32",
|
|
10537
|
-
"id":
|
|
10544
|
+
"id": 10,
|
|
10538
10545
|
"options": {
|
|
10539
10546
|
"default": 3
|
|
10540
10547
|
}
|
|
@@ -10542,44 +10549,44 @@
|
|
|
10542
10549
|
"seqno": {
|
|
10543
10550
|
"rule": "required",
|
|
10544
10551
|
"type": "uint32",
|
|
10545
|
-
"id":
|
|
10552
|
+
"id": 11
|
|
10546
10553
|
},
|
|
10547
10554
|
"expire_at": {
|
|
10548
10555
|
"rule": "required",
|
|
10549
10556
|
"type": "uint64",
|
|
10550
|
-
"id":
|
|
10557
|
+
"id": 12
|
|
10551
10558
|
},
|
|
10552
10559
|
"wallet_version": {
|
|
10553
10560
|
"type": "TonWalletVersion",
|
|
10554
|
-
"id":
|
|
10561
|
+
"id": 13,
|
|
10555
10562
|
"options": {
|
|
10556
10563
|
"default": "V4R2"
|
|
10557
10564
|
}
|
|
10558
10565
|
},
|
|
10559
10566
|
"wallet_id": {
|
|
10560
10567
|
"type": "uint32",
|
|
10561
|
-
"id":
|
|
10568
|
+
"id": 14,
|
|
10562
10569
|
"options": {
|
|
10563
10570
|
"default": 698983191
|
|
10564
10571
|
}
|
|
10565
10572
|
},
|
|
10566
10573
|
"workchain": {
|
|
10567
10574
|
"type": "TonWorkChain",
|
|
10568
|
-
"id":
|
|
10575
|
+
"id": 15,
|
|
10569
10576
|
"options": {
|
|
10570
10577
|
"default": "BASECHAIN"
|
|
10571
10578
|
}
|
|
10572
10579
|
},
|
|
10573
10580
|
"is_bounceable": {
|
|
10574
10581
|
"type": "bool",
|
|
10575
|
-
"id":
|
|
10582
|
+
"id": 16,
|
|
10576
10583
|
"options": {
|
|
10577
10584
|
"default": false
|
|
10578
10585
|
}
|
|
10579
10586
|
},
|
|
10580
10587
|
"is_testnet_only": {
|
|
10581
10588
|
"type": "bool",
|
|
10582
|
-
"id":
|
|
10589
|
+
"id": 17,
|
|
10583
10590
|
"options": {
|
|
10584
10591
|
"default": false
|
|
10585
10592
|
}
|
|
@@ -10587,12 +10594,12 @@
|
|
|
10587
10594
|
"ext_destination": {
|
|
10588
10595
|
"rule": "repeated",
|
|
10589
10596
|
"type": "string",
|
|
10590
|
-
"id":
|
|
10597
|
+
"id": 18
|
|
10591
10598
|
},
|
|
10592
10599
|
"ext_ton_amount": {
|
|
10593
10600
|
"rule": "repeated",
|
|
10594
10601
|
"type": "uint64",
|
|
10595
|
-
"id":
|
|
10602
|
+
"id": 19,
|
|
10596
10603
|
"options": {
|
|
10597
10604
|
"packed": false
|
|
10598
10605
|
}
|
|
@@ -10600,7 +10607,7 @@
|
|
|
10600
10607
|
"ext_payload": {
|
|
10601
10608
|
"rule": "repeated",
|
|
10602
10609
|
"type": "string",
|
|
10603
|
-
"id":
|
|
10610
|
+
"id": 20
|
|
10604
10611
|
}
|
|
10605
10612
|
}
|
|
10606
10613
|
},
|