Skip to content

Commit ad83be8

Browse files
authored
[LUM-548] Upgrade dependencies and add Amino types (#53)
* Upgrade dependencies and add types in Amino types * Remove console.log * Revamp signTx function * Update error message * Bump to 0.7.15 * Update docs * Fix signTx function
1 parent f592247 commit ad83be8

18 files changed

+324
-293
lines changed

docs/lib/classes/lumclient.md

+26-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
- [searchTx](LumClient.md#searchtx)
2929
- [signAndBroadcastTx](LumClient.md#signandbroadcasttx)
3030
- [signTx](LumClient.md#signtx)
31+
- [signTxFromWallet](LumClient.md#signtxfromwallet)
3132
- [status](LumClient.md#status)
3233
- [txsQuery](LumClient.md#txsquery)
3334
- [connect](LumClient.md#connect)
@@ -291,15 +292,21 @@ ___
291292

292293
### signTx
293294

294-
**signTx**(`wallet`, `doc`): `Promise`<`Uint8Array`\>
295+
**signTx**<`T`\>(`wallets`, `doc`): `Promise`<`Uint8Array`\>
295296

296297
Signs the messages using the provided wallet and builds the transaction
297298

299+
#### Type parameters
300+
301+
| Name |
302+
| :------ |
303+
| `T` |
304+
298305
#### Parameters
299306

300307
| Name | Type | Description |
301308
| :------ | :------ | :------ |
302-
| `wallet` | [`LumWallet`](LumWallet.md) \| [`LumWallet`](LumWallet.md)[] | signing wallet or wallets for multi signature |
309+
| `wallets` | `T` | signing wallets for multi signature |
303310
| `doc` | [`Doc`](../interfaces/LumTypes.Doc.md) | document to sign |
304311

305312
#### Returns
@@ -308,6 +315,23 @@ Signs the messages using the provided wallet and builds the transaction
308315

309316
___
310317

318+
### signTxFromWallet
319+
320+
**signTxFromWallet**(`wallet`, `doc`): `Promise`<[`SignDoc`, `Uint8Array`]\>
321+
322+
#### Parameters
323+
324+
| Name | Type |
325+
| :------ | :------ |
326+
| `wallet` | [`LumWallet`](LumWallet.md) |
327+
| `doc` | [`Doc`](../interfaces/LumTypes.Doc.md) |
328+
329+
#### Returns
330+
331+
`Promise`<[`SignDoc`, `Uint8Array`]\>
332+
333+
___
334+
311335
### status
312336

313337
**status**(): `Promise`<`StatusResponse`\>

docs/lib/classes/lumledgerwallet.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ ___
193193

194194
### signTransaction
195195

196-
**signTransaction**(`doc`): `Promise`<[[`SignDoc`](../interfaces/LumTypes.SignDoc.md), `Uint8Array`]\>
196+
**signTransaction**(`doc`): `Promise`<[`SignDoc`, `Uint8Array`]\>
197197

198198
Sign a transaction document using a LumWallet
199199

@@ -205,7 +205,7 @@ Sign a transaction document using a LumWallet
205205

206206
#### Returns
207207

208-
`Promise`<[[`SignDoc`](../interfaces/LumTypes.SignDoc.md), `Uint8Array`]\>
208+
`Promise`<[`SignDoc`, `Uint8Array`]\>
209209

210210
#### Overrides
211211

docs/lib/classes/lumpaperwallet.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ ___
189189

190190
### signTransaction
191191

192-
**signTransaction**(`doc`): `Promise`<[[`SignDoc`](../interfaces/LumTypes.SignDoc.md), `Uint8Array`]\>
192+
**signTransaction**(`doc`): `Promise`<[`SignDoc`, `Uint8Array`]\>
193193

194194
Sign a transaction document using a LumWallet
195195

@@ -201,7 +201,7 @@ Sign a transaction document using a LumWallet
201201

202202
#### Returns
203203

204-
`Promise`<[[`SignDoc`](../interfaces/LumTypes.SignDoc.md), `Uint8Array`]\>
204+
`Promise`<[`SignDoc`, `Uint8Array`]\>
205205

206206
#### Overrides
207207

docs/lib/classes/lumwallet.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ ___
137137

138138
### signTransaction
139139

140-
`Abstract` **signTransaction**(`doc`): `Promise`<[[`SignDoc`](../interfaces/LumTypes.SignDoc.md), `Uint8Array`]\>
140+
`Abstract` **signTransaction**(`doc`): `Promise`<[`SignDoc`, `Uint8Array`]\>
141141

142142
Sign a transaction document using a LumWallet
143143

@@ -149,7 +149,7 @@ Sign a transaction document using a LumWallet
149149

150150
#### Returns
151151

152-
`Promise`<[[`SignDoc`](../interfaces/LumTypes.SignDoc.md), `Uint8Array`]\>
152+
`Promise`<[`SignDoc`, `Uint8Array`]\>
153153

154154
___
155155

docs/lib/interfaces/lumtypes.signdoc.md

-48
This file was deleted.

docs/lib/modules/lumtypes.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,24 @@
1616
- [LogAttribute](../interfaces/LumTypes.LogAttribute.md)
1717
- [LogEvent](../interfaces/LumTypes.LogEvent.md)
1818
- [PubKey](../interfaces/LumTypes.PubKey.md)
19-
- [SignDoc](../interfaces/LumTypes.SignDoc.md)
2019
- [SignMsg](../interfaces/LumTypes.SignMsg.md)
2120
- [Tx](../interfaces/LumTypes.Tx.md)
2221

22+
### Type aliases
23+
24+
- [SignDoc](LumTypes.md#signdoc)
25+
2326
### Variables
2427

2528
- [PubKey](LumTypes.md#pubkey)
2629
- [Tx](LumTypes.md#tx)
2730

31+
## Type aliases
32+
33+
### SignDoc
34+
35+
Ƭ **SignDoc**: `SignDocCosmos`
36+
2837
## Variables
2938

3039
### PubKey

docs/lib/modules/lumutils.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ ___
230230

231231
### generateSignDoc
232232

233-
`Const` **generateSignDoc**(`doc`, `signerIdx`, `signMode`): [`SignDoc`](../interfaces/LumTypes.SignDoc.md)
233+
`Const` **generateSignDoc**(`doc`, `signerIdx`, `signMode`): `SignDoc`
234234

235235
Generate transaction doc to be signed
236236

@@ -244,7 +244,7 @@ Generate transaction doc to be signed
244244

245245
#### Returns
246246

247-
[`SignDoc`](../interfaces/LumTypes.SignDoc.md)
247+
`SignDoc`
248248

249249
___
250250

@@ -258,7 +258,7 @@ Generate transaction sign doc bytes used to sign the transaction
258258

259259
| Name | Type | Description |
260260
| :------ | :------ | :------ |
261-
| `signDoc` | [`SignDoc`](../interfaces/LumTypes.SignDoc.md) | sign doc (as generated by the generateSignDoc function) |
261+
| `signDoc` | `SignDoc` | sign doc (as generated by the generateSignDoc function) |
262262

263263
#### Returns
264264

@@ -295,7 +295,7 @@ Generate transaction bytes to broadcast
295295

296296
| Name | Type | Description |
297297
| :------ | :------ | :------ |
298-
| `signDoc` | [`SignDoc`](../interfaces/LumTypes.SignDoc.md) | sign doc (as generated by the generateSignDoc function) |
298+
| `signDoc` | `SignDoc` | sign doc (as generated by the generateSignDoc function) |
299299
| `signatures` | `Uint8Array`[] | transaction signatures (as generated by the generateSignature function) |
300300

301301
#### Returns

package.json

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lum-network/sdk-javascript",
3-
"version": "0.7.14",
3+
"version": "0.7.15",
44
"license": "Apache-2.0",
55
"description": "Javascript SDK library for NodeJS and Web browsers to interact with the Lum Network.",
66
"homepage": "https://github.com/lum-network/sdk-javascript#readme",
@@ -35,28 +35,28 @@
3535
"format": "prettier --write '**/*.{js,jsx,ts,tsx,css,json,md,html,yml}'",
3636
"bump": "npm version",
3737
"preget-proto": "rm -rf proto",
38-
"get-proto": "COSMOS_REF=v0.46.7 IBC_REF=v5.0.1 LUM_REF=v1.3.0 sh ./scripts/get-proto.sh",
38+
"get-proto": "COSMOS_REF=v0.46.7 IBC_REF=v5.0.1 LUM_REF=v1.3.1 sh ./scripts/get-proto.sh",
3939
"define-proto": "sh ./scripts/define-proto.sh",
4040
"postdefine-proto": "prettier --write \"src/codec/**/*.ts\""
4141
},
4242
"dependencies": {
43-
"@cosmjs/amino": "0.26.5",
44-
"@cosmjs/crypto": "0.26.5",
45-
"@cosmjs/encoding": "0.26.5",
46-
"@cosmjs/math": "0.26.5",
47-
"@cosmjs/proto-signing": "0.26.5",
48-
"@cosmjs/stargate": "0.26.5",
49-
"@cosmjs/tendermint-rpc": "0.26.5",
50-
"@cosmjs/utils": "0.26.5",
51-
"@ledgerhq/hw-app-cosmos": "^6.11.2",
52-
"@ledgerhq/hw-transport": "^6.11.2",
53-
"@types/crypto-js": "^4.0.2",
43+
"@cosmjs/amino": "0.29.5",
44+
"@cosmjs/crypto": "0.29.5",
45+
"@cosmjs/encoding": "0.29.5",
46+
"@cosmjs/math": "0.29.5",
47+
"@cosmjs/proto-signing": "0.29.5",
48+
"@cosmjs/stargate": "0.29.5",
49+
"@cosmjs/tendermint-rpc": "0.29.5",
50+
"@cosmjs/utils": "0.29.5",
51+
"@ledgerhq/hw-app-cosmos": "^6.27.10",
52+
"@ledgerhq/hw-transport": "^6.27.10",
53+
"@types/crypto-js": "^4.1.1",
5454
"@types/ledgerhq__hw-transport": "^4.21.4",
55-
"@types/uuid": "^8.3.1",
55+
"@types/uuid": "^9.0.0",
5656
"crypto-browserify": "^3.12.0",
5757
"crypto-js": "^4.1.1",
58-
"long": "^4.0.0",
59-
"uuid": "^8.3.2"
58+
"long": "^5.2.1",
59+
"uuid": "^9.0.0"
6060
},
6161
"optionalDependencies": {},
6262
"devDependencies": {

0 commit comments

Comments
 (0)