@ledgerhq/hw-app-trx 6.7.0 → 6.11.2
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/README.md +41 -41
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -13,26 +13,26 @@ Ledger Hardware Wallet TRX JavaScript bindings.
|
|
|
13
13
|
|
|
14
14
|
#### Table of Contents
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
16
|
+
* [Trx](#trx)
|
|
17
|
+
* [Parameters](#parameters)
|
|
18
|
+
* [Examples](#examples)
|
|
19
|
+
* [getAddress](#getaddress)
|
|
20
|
+
* [Parameters](#parameters-1)
|
|
21
|
+
* [Examples](#examples-1)
|
|
22
|
+
* [signTransaction](#signtransaction)
|
|
23
|
+
* [Parameters](#parameters-2)
|
|
24
|
+
* [Examples](#examples-2)
|
|
25
|
+
* [signTransactionHash](#signtransactionhash)
|
|
26
|
+
* [Parameters](#parameters-3)
|
|
27
|
+
* [Examples](#examples-3)
|
|
28
|
+
* [getAppConfiguration](#getappconfiguration)
|
|
29
|
+
* [Examples](#examples-4)
|
|
30
|
+
* [signPersonalMessage](#signpersonalmessage)
|
|
31
|
+
* [Parameters](#parameters-4)
|
|
32
|
+
* [Examples](#examples-5)
|
|
33
|
+
* [getECDHPairKey](#getecdhpairkey)
|
|
34
|
+
* [Parameters](#parameters-5)
|
|
35
|
+
* [Examples](#examples-6)
|
|
36
36
|
|
|
37
37
|
### Trx
|
|
38
38
|
|
|
@@ -40,8 +40,8 @@ Tron API
|
|
|
40
40
|
|
|
41
41
|
#### Parameters
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
* `transport` **Transport**
|
|
44
|
+
* `scrambleKey` (optional, default `"TRX"`)
|
|
45
45
|
|
|
46
46
|
#### Examples
|
|
47
47
|
|
|
@@ -56,8 +56,8 @@ get Tron address for a given BIP 32 path.
|
|
|
56
56
|
|
|
57
57
|
##### Parameters
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
* `path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** a path in BIP 32 format
|
|
60
|
+
* `boolDisplay` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?**
|
|
61
61
|
|
|
62
62
|
##### Examples
|
|
63
63
|
|
|
@@ -65,7 +65,7 @@ get Tron address for a given BIP 32 path.
|
|
|
65
65
|
const address = await tron.getAddress("44'/195'/0'/0/0").then(o => o.address)
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)
|
|
68
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<{publicKey: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), address: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}>** an object with a publicKey and address
|
|
69
69
|
|
|
70
70
|
#### signTransaction
|
|
71
71
|
|
|
@@ -73,9 +73,9 @@ sign a Tron transaction with a given BIP 32 path and Token Names
|
|
|
73
73
|
|
|
74
74
|
##### Parameters
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
* `path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** a path in BIP 32 format
|
|
77
|
+
* `rawTxHex` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** a raw transaction hex string
|
|
78
|
+
* `tokenSignatures` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** Tokens Signatures array
|
|
79
79
|
|
|
80
80
|
##### Examples
|
|
81
81
|
|
|
@@ -83,7 +83,7 @@ sign a Tron transaction with a given BIP 32 path and Token Names
|
|
|
83
83
|
const signature = await tron.signTransaction("44'/195'/0'/0/0", "0a02f5942208704dda506d59dceb40f0f4978f802e5a69080112650a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412340a1541978dbd103cfe59c35e753d09dd44ae1ae64621c7121541e2ae49db6a70b9b4757d2137a43b69b24a445780188ef8b5ba0470cbb5948f802e", [], 105);
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)
|
|
86
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** a signature as hex string
|
|
87
87
|
|
|
88
88
|
#### signTransactionHash
|
|
89
89
|
|
|
@@ -91,9 +91,9 @@ sign a Tron transaction hash with a given BIP 32 path
|
|
|
91
91
|
|
|
92
92
|
##### Parameters
|
|
93
93
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
* `path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** a path in BIP 32 format
|
|
95
|
+
* `rawTxHashHex` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
96
|
+
* `rawTxHex` a raw transaction hex string
|
|
97
97
|
|
|
98
98
|
##### Examples
|
|
99
99
|
|
|
@@ -101,7 +101,7 @@ sign a Tron transaction hash with a given BIP 32 path
|
|
|
101
101
|
const signature = await tron.signTransactionHash("44'/195'/0'/0/0", "25b18a55f86afb10e7aca38d0073d04c80397c6636069193953fdefaea0b8369");
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)
|
|
104
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** a signature as hex string
|
|
105
105
|
|
|
106
106
|
#### getAppConfiguration
|
|
107
107
|
|
|
@@ -121,7 +121,7 @@ const result = await tron.getAppConfiguration();
|
|
|
121
121
|
}
|
|
122
122
|
```
|
|
123
123
|
|
|
124
|
-
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)
|
|
124
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<{allowContract: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean), truncateAddress: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean), allowData: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean), signByHash: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean), version: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), versionN: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)}>** an object with a version
|
|
125
125
|
|
|
126
126
|
#### signPersonalMessage
|
|
127
127
|
|
|
@@ -129,9 +129,9 @@ sign a Tron Message with a given BIP 32 path
|
|
|
129
129
|
|
|
130
130
|
##### Parameters
|
|
131
131
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
132
|
+
* `path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** a path in BIP 32 format
|
|
133
|
+
* `messageHex` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
134
|
+
* `message` hex string to sign
|
|
135
135
|
|
|
136
136
|
##### Examples
|
|
137
137
|
|
|
@@ -139,7 +139,7 @@ sign a Tron Message with a given BIP 32 path
|
|
|
139
139
|
const signature = await tron.signPersonalMessage("44'/195'/0'/0/0", "43727970746f436861696e2d54726f6e5352204c6564676572205472616e73616374696f6e73205465737473");
|
|
140
140
|
```
|
|
141
141
|
|
|
142
|
-
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)
|
|
142
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** a signature as hex string
|
|
143
143
|
|
|
144
144
|
#### getECDHPairKey
|
|
145
145
|
|
|
@@ -147,8 +147,8 @@ get Tron address for a given BIP 32 path.
|
|
|
147
147
|
|
|
148
148
|
##### Parameters
|
|
149
149
|
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
* `path` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** a path in BIP 32 format
|
|
151
|
+
* `publicKey` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** address public key to generate pair key
|
|
152
152
|
|
|
153
153
|
##### Examples
|
|
154
154
|
|
|
@@ -156,4 +156,4 @@ get Tron address for a given BIP 32 path.
|
|
|
156
156
|
const signature = await tron.getECDHPairKey("44'/195'/0'/0/0", "04ff21f8e64d3a3c0198edfbb7afdc79be959432e92e2f8a1984bb436a414b8edcec0345aad0c1bf7da04fd036dd7f9f617e30669224283d950fab9dd84831dc83");
|
|
157
157
|
```
|
|
158
158
|
|
|
159
|
-
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)
|
|
159
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** shared key hex string,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/hw-app-trx",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.11.2",
|
|
4
4
|
"description": "Ledger Hardware Wallet Tron Application API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ledger",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"types": "lib/Trx.d.ts",
|
|
28
28
|
"license": "Apache-2.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@ledgerhq/errors": "^6.
|
|
31
|
-
"@ledgerhq/hw-transport": "^6.
|
|
30
|
+
"@ledgerhq/errors": "^6.10.0",
|
|
31
|
+
"@ledgerhq/hw-transport": "^6.11.2"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"clean": "bash ../../script/clean.sh",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"watch": "bash ../../script/watch.sh",
|
|
37
37
|
"doc": "bash ../../script/doc.sh"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "d243550a31bd781924fc301492320b16212c3dbe"
|
|
40
40
|
}
|