Skip to content

Commit c03115c

Browse files
authored
Bring changes to production (#38)
* Update auto generated doc * Implement full offline signer capability (#37) * Improve abstraction to handle amino offline signer * Bump version to 0.7.2 * Remove useless double check which might cause reflection issues * Fix offline signing Co-authored-by: Fabrice Bascoulergue <lebascou@users.noreply.github.com> Co-authored-by: Fabrice Bascoulergue <lebascou@users.noreply.github.com>
1 parent 531c627 commit c03115c

File tree

11 files changed

+267
-65
lines changed

11 files changed

+267
-65
lines changed

docs/lib/classes/lumclient.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ ___
5656

5757
### queryClient
5858

59-
`Readonly` **queryClient**: `QueryClient` & `AuthExtension` & `AuthzExtension` & `BankExtension` & `BeamExtension` & `DistributionExtension` & `GovExtension` & `IbcExtension` & `MintExtension` & `StakingExtension` & `SlashingExtension` & `FeegrantExtension`
59+
`Readonly` **queryClient**: `QueryClient` & `AuthExtension` & `AuthzExtension` & `BankExtension` & `BeamExtension` & `DistributionExtension` & `GovExtension` & `IbcExtension` & `MintExtension` & `StakingExtension` & `SlashingExtension` & `FeegrantExtension` & `AirdropExtension`
6060

6161
___
6262

docs/lib/classes/lumpaperwallet.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,10 @@ Change the wallet to use
233233

234234
#### Parameters
235235

236-
| Name | Type |
237-
| :------ | :------ |
238-
| `hdPath` | `string` |
239-
| `addressPrefix` | `string` |
236+
| Name | Type | Default value |
237+
| :------ | :------ | :------ |
238+
| `hdPath` | `string` | `undefined` |
239+
| `addressPrefix` | `string` | `LumConstants.LumBech32PrefixAccAddr` |
240240

241241
#### Returns
242242

docs/lib/classes/lumwalletfactory.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ Create a LumWallet instance based on a keystore
3030

3131
#### Parameters
3232

33-
| Name | Type | Description |
34-
| :------ | :------ | :------ |
35-
| `keystore` | `string` \| [`KeyStore`](../interfaces/LumUtils.KeyStore.md) | keystore used to decypher the private key |
36-
| `password` | `string` | keystore password |
37-
| `addressPrefix` | `string` | prefix to use to derive the address from the public key (ex: lum) |
33+
| Name | Type | Default value | Description |
34+
| :------ | :------ | :------ | :------ |
35+
| `keystore` | `string` \| [`KeyStore`](../interfaces/LumUtils.KeyStore.md) | `undefined` | keystore used to decypher the private key |
36+
| `password` | `string` | `undefined` | keystore password |
37+
| `addressPrefix` | `string` | `LumConstants.LumBech32PrefixAccAddr` | prefix to use to derive the address from the public key (ex: lum) |
3838

3939
#### Returns
4040

@@ -50,11 +50,11 @@ Create a LumWallet instance based on a ledger transport
5050

5151
#### Parameters
5252

53-
| Name | Type | Description |
54-
| :------ | :------ | :------ |
55-
| `transport` | `default` | Ledger transport to use (https://github.com/LedgerHQ/ledgerjs) |
56-
| `hdPath` | `string` | BIP44 derivation path |
57-
| `addressPrefix` | `string` | prefix to use to derive the address from the public key (ex: lum) |
53+
| Name | Type | Default value | Description |
54+
| :------ | :------ | :------ | :------ |
55+
| `transport` | `default` | `undefined` | Ledger transport to use (https://github.com/LedgerHQ/ledgerjs) |
56+
| `hdPath` | `string` | `undefined` | BIP44 derivation path |
57+
| `addressPrefix` | `string` | `LumConstants.LumBech32PrefixAccAddr` | prefix to use to derive the address from the public key (ex: lum) |
5858

5959
#### Returns
6060

@@ -70,11 +70,11 @@ Create a LumWallet instance based on a mnemonic and a derivation path
7070

7171
#### Parameters
7272

73-
| Name | Type | Description |
74-
| :------ | :------ | :------ |
75-
| `mnemonic` | `string` | mnemonic used to derive the private key |
76-
| `hdPath` | `string` | BIP44 derivation path |
77-
| `addressPrefix` | `string` | prefix to use to derive the address from the public key (ex: lum) |
73+
| Name | Type | Default value | Description |
74+
| :------ | :------ | :------ | :------ |
75+
| `mnemonic` | `string` | `undefined` | mnemonic used to derive the private key |
76+
| `hdPath` | `string` | `undefined` | BIP44 derivation path |
77+
| `addressPrefix` | `string` | `LumConstants.LumBech32PrefixAccAddr` | prefix to use to derive the address from the public key (ex: lum) |
7878

7979
#### Returns
8080

@@ -92,7 +92,7 @@ Create a LumWallet instance based on an OfflineDirectSigner instance compatible
9292

9393
| Name | Type | Description |
9494
| :------ | :------ | :------ |
95-
| `offlineSigner` | `OfflineDirectSigner` | OfflineDirectSigner instance compatible with Comsjs based implementations |
95+
| `offlineSigner` | `OfflineSigner` | OfflineDirectSigner instance compatible with Comsjs based implementations |
9696

9797
#### Returns
9898

@@ -108,10 +108,10 @@ Create a LumWallet instance based on a private key (secp256k1)
108108

109109
#### Parameters
110110

111-
| Name | Type | Description |
112-
| :------ | :------ | :------ |
113-
| `privateKey` | `Uint8Array` | wallet private key (secp256k1) |
114-
| `addressPrefix` | `string` | prefix to use to derive the address from the public key (ex: lum) |
111+
| Name | Type | Default value | Description |
112+
| :------ | :------ | :------ | :------ |
113+
| `privateKey` | `Uint8Array` | `undefined` | wallet private key (secp256k1) |
114+
| `addressPrefix` | `string` | `LumConstants.LumBech32PrefixAccAddr` | prefix to use to derive the address from the public key (ex: lum) |
115115

116116
#### Returns
117117

docs/lib/interfaces/lumtypes.account.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,48 @@
66

77
### Properties
88

9+
- [\_baseVestingAccount](LumTypes.Account.md#_basevestingaccount)
10+
- [\_continuousVestingAccount](LumTypes.Account.md#_continuousvestingaccount)
11+
- [\_delayedVestingAccount](LumTypes.Account.md#_delayedvestingaccount)
12+
- [\_moduleAccount](LumTypes.Account.md#_moduleaccount)
13+
- [\_periodicVestingAccount](LumTypes.Account.md#_periodicvestingaccount)
914
- [accountNumber](LumTypes.Account.md#accountnumber)
1015
- [address](LumTypes.Account.md#address)
16+
- [pubkey](LumTypes.Account.md#pubkey)
1117
- [sequence](LumTypes.Account.md#sequence)
1218

1319
## Properties
1420

21+
### \_baseVestingAccount
22+
23+
`Optional` `Readonly` **\_baseVestingAccount**: `BaseVestingAccount`
24+
25+
___
26+
27+
### \_continuousVestingAccount
28+
29+
`Optional` `Readonly` **\_continuousVestingAccount**: `ContinuousVestingAccount`
30+
31+
___
32+
33+
### \_delayedVestingAccount
34+
35+
`Optional` `Readonly` **\_delayedVestingAccount**: `DelayedVestingAccount`
36+
37+
___
38+
39+
### \_moduleAccount
40+
41+
`Optional` `Readonly` **\_moduleAccount**: `ModuleAccount`
42+
43+
___
44+
45+
### \_periodicVestingAccount
46+
47+
`Optional` `Readonly` **\_periodicVestingAccount**: `PeriodicVestingAccount`
48+
49+
___
50+
1551
### accountNumber
1652

1753
`Readonly` **accountNumber**: `number`
@@ -24,6 +60,12 @@ ___
2460

2561
___
2662

63+
### pubkey
64+
65+
`Readonly` **pubkey**: ``null`` \| `Pubkey`
66+
67+
___
68+
2769
### sequence
2870

2971
`Readonly` **sequence**: `number`

docs/lib/interfaces/lumtypes.log.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
- [events](LumTypes.Log.md#events)
1010
- [log](LumTypes.Log.md#log)
11-
- [msg_index](LumTypes.Log.md#msg_index)
11+
- [msg\_index](LumTypes.Log.md#msg_index)
1212

1313
## Properties
1414

docs/lib/modules/lummessages.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- [MsgBeginRedelegateUrl](LumMessages.md#msgbeginredelegateurl)
1212
- [MsgClaimBeamUrl](LumMessages.md#msgclaimbeamurl)
1313
- [MsgCreateValidatorUrl](LumMessages.md#msgcreatevalidatorurl)
14+
- [MsgCreateVestingAccountUrl](LumMessages.md#msgcreatevestingaccounturl)
1415
- [MsgDelegateUrl](LumMessages.md#msgdelegateurl)
1516
- [MsgDepositUrl](LumMessages.md#msgdepositurl)
1617
- [MsgEditValidatorUrl](LumMessages.md#msgeditvalidatorurl)
@@ -37,6 +38,7 @@
3738
- [BuildMsgBeginRedelegate](LumMessages.md#buildmsgbeginredelegate)
3839
- [BuildMsgClaimBeam](LumMessages.md#buildmsgclaimbeam)
3940
- [BuildMsgCreateValidator](LumMessages.md#buildmsgcreatevalidator)
41+
- [BuildMsgCreateVestingAccount](LumMessages.md#buildmsgcreatevestingaccount)
4042
- [BuildMsgDelegate](LumMessages.md#buildmsgdelegate)
4143
- [BuildMsgDeposit](LumMessages.md#buildmsgdeposit)
4244
- [BuildMsgEditValidator](LumMessages.md#buildmsgeditvalidator)
@@ -78,6 +80,12 @@ ___
7880

7981
___
8082

83+
### MsgCreateVestingAccountUrl
84+
85+
**MsgCreateVestingAccountUrl**: ``"/cosmos.vesting.v1beta1.MsgCreateVestingAccount"``
86+
87+
___
88+
8189
### MsgDelegateUrl
8290

8391
**MsgDelegateUrl**: ``"/cosmos.staking.v1beta1.MsgDelegate"``
@@ -194,7 +202,7 @@ ___
194202

195203
### MsgWithdrawValidatorCommissionUrl
196204

197-
**MsgWithdrawValidatorCommissionUrl**: ``"/cosmos.bank.v1beta1.MsgSend"``
205+
**MsgWithdrawValidatorCommissionUrl**: ``"/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission"``
198206

199207
## Functions
200208

@@ -257,6 +265,26 @@ ___
257265

258266
___
259267

268+
### BuildMsgCreateVestingAccount
269+
270+
`Const` **BuildMsgCreateVestingAccount**(`fromAddress`, `toAddress`, `amount`, `endTime`, `delayed`): [`Message`](../interfaces/LumMessages.Message.md)
271+
272+
#### Parameters
273+
274+
| Name | Type |
275+
| :------ | :------ |
276+
| `fromAddress` | `string` |
277+
| `toAddress` | `string` |
278+
| `amount` | [`Coin`](../interfaces/LumTypes.Coin.md)[] |
279+
| `endTime` | `Long` |
280+
| `delayed` | `boolean` |
281+
282+
#### Returns
283+
284+
[`Message`](../interfaces/LumMessages.Message.md)
285+
286+
___
287+
260288
### BuildMsgDelegate
261289

262290
`Const` **BuildMsgDelegate**(`delegatorAddress`, `validatorAddress`, `amount?`): [`Message`](../interfaces/LumMessages.Message.md)

docs/lib/modules/lumutils.md

Lines changed: 57 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88

99
### Functions
1010

11+
- [accountFromAny](LumUtils.md#accountfromany)
1112
- [broadcastTxCommitSuccess](LumUtils.md#broadcasttxcommitsuccess)
1213
- [broadcastTxSyncSuccess](LumUtils.md#broadcasttxsyncsuccess)
1314
- [convertUnit](LumUtils.md#convertunit)
15+
- [estimatedVesting](LumUtils.md#estimatedvesting)
1416
- [generateAuthInfoBytes](LumUtils.md#generateauthinfobytes)
1517
- [generateKeyStore](LumUtils.md#generatekeystore)
1618
- [generateMnemonic](LumUtils.md#generatemnemonic)
@@ -47,6 +49,22 @@
4749

4850
## Functions
4951

52+
### accountFromAny
53+
54+
`Const` **accountFromAny**(`input`): [`Account`](../interfaces/LumTypes.Account.md)
55+
56+
#### Parameters
57+
58+
| Name | Type |
59+
| :------ | :------ |
60+
| `input` | `Any` |
61+
62+
#### Returns
63+
64+
[`Account`](../interfaces/LumTypes.Account.md)
65+
66+
___
67+
5068
### broadcastTxCommitSuccess
5169

5270
`Const` **broadcastTxCommitSuccess**(`response`): `boolean`
@@ -108,6 +126,37 @@ the amount converted
108126

109127
___
110128

129+
### estimatedVesting
130+
131+
`Const` **estimatedVesting**(`account`, `t?`, `denom?`): `Object`
132+
133+
#### Parameters
134+
135+
| Name | Type | Default value |
136+
| :------ | :------ | :------ |
137+
| `account` | [`Account`](../interfaces/LumTypes.Account.md) | `undefined` |
138+
| `t?` | `Date` | `undefined` |
139+
| `denom` | `string` | `LumConstants.MicroLumDenom` |
140+
141+
#### Returns
142+
143+
`Object`
144+
145+
| Name | Type |
146+
| :------ | :------ |
147+
| `endsAt` | `Date` |
148+
| `lockedBankCoins` | [`Coin`](../interfaces/LumTypes.Coin.md) |
149+
| `lockedCoins` | [`Coin`](../interfaces/LumTypes.Coin.md) |
150+
| `lockedDelegatedCoins` | [`Coin`](../interfaces/LumTypes.Coin.md) |
151+
| `lockedPercentage` | `number` |
152+
| `startsAt` | `Date` |
153+
| `time` | `Date` |
154+
| `totalCoins` | [`Coin`](../interfaces/LumTypes.Coin.md) |
155+
| `unlockedCoins` | [`Coin`](../interfaces/LumTypes.Coin.md) |
156+
| `unlockedPercentage` | `number` |
157+
158+
___
159+
111160
### generateAuthInfoBytes
112161

113162
`Const` **generateAuthInfoBytes**(`docSigners`, `fee`, `signMode`): `Uint8Array`
@@ -263,10 +312,10 @@ Derives a bech32 wallet address from a public key (secp256k1)
263312

264313
#### Parameters
265314

266-
| Name | Type | Description |
267-
| :------ | :------ | :------ |
268-
| `publicKey` | `Uint8Array` | public key to derive the address from |
269-
| `prefix` | `string` | address prefix to use (ex: lum) |
315+
| Name | Type | Default value | Description |
316+
| :------ | :------ | :------ | :------ |
317+
| `publicKey` | `Uint8Array` | `undefined` | public key to derive the address from |
318+
| `prefix` | `string` | `LumBech32PrefixAccAddr` | address prefix to use (ex: lum) |
270319

271320
#### Returns
272321

@@ -377,10 +426,10 @@ Verify that a wallet address is valid
377426

378427
#### Parameters
379428

380-
| Name | Type | Description |
381-
| :------ | :------ | :------ |
382-
| `address` | `string` | address to check |
383-
| `prefix` | `undefined` \| `string` | prefix to check (will not be checked if not provided) |
429+
| Name | Type | Default value | Description |
430+
| :------ | :------ | :------ | :------ |
431+
| `address` | `string` | `undefined` | address to check |
432+
| `prefix` | `undefined` \| `string` | `LumBech32PrefixAccAddr` | prefix to check (will not be checked if not provided) |
384433

385434
#### Returns
386435

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lum-network/sdk-javascript",
3-
"version": "0.7.1",
3+
"version": "0.7.2",
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",

0 commit comments

Comments
 (0)