Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ console.log(`Wallet address: ${wallet.address}`);
### Hardware wallets

**IMPORTANT NOTES:**
- Transaction signature using Hardware devices is currently work in progress, therefore broadcasting a transaction is not possible at the moment.
- Derivation path using the Cosmos Ledger application cannot be set to the default Lum Path for now `m/44'/118'/0'/*/*` and must remain on the Cosmos path `m/44'/'837/0'/*/*`
- Transaction signature using Ledger only works with legacy amino (wich will be deprecated at some point)
- Derivation path using the Cosmos Ledger application cannot be set to the default Lum Path for now `m/44'/837'/0'/*/*` and must remain on the Cosmos path `m/44'/'118/0'/*/*`

#### Ledger

Expand Down
10 changes: 10 additions & 0 deletions docs/lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,24 @@
### Classes

- [LumClient](classes/lumclient.md)
- [LumLedgerWallet](classes/lumledgerwallet.md)
- [LumPaperWallet](classes/lumpaperwallet.md)
- [LumWallet](classes/lumwallet.md)
- [LumWalletFactory](classes/lumwalletfactory.md)

### Variables

- [LumAminoRegistry](README.md#lumaminoregistry)
- [LumRegistry](README.md#lumregistry)

## Variables

### LumAminoRegistry

• `Const` **LumAminoRegistry**: *AminoTypes*

___

### LumRegistry

• `Const` **LumRegistry**: *ExtendedRegistry*
38 changes: 8 additions & 30 deletions docs/lib/classes/lumclient.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
- [getChainId](lumclient.md#getchainid)
- [getSupply](lumclient.md#getsupply)
- [getTx](lumclient.md#gettx)
- [getValidators](lumclient.md#getvalidators)
- [searchTx](lumclient.md#searchtx)
- [signAndBroadcastTx](lumclient.md#signandbroadcasttx)
- [signTx](lumclient.md#signtx)
Expand All @@ -39,15 +38,15 @@

### constructor

\+ **new LumClient**(`tmClient`: *Client*): [*LumClient*](lumclient.md)
\+ **new LumClient**(`tmClient`: *Tendermint34Client*): [*LumClient*](lumclient.md)

Create a LumClient instance using a tendermint RPC client

#### Parameters:

Name | Type | Description |
:------ | :------ | :------ |
`tmClient` | *Client* | tendermint RPC client |
`tmClient` | *Tendermint34Client* | tendermint RPC client |

**Returns:** [*LumClient*](lumclient.md)

Expand All @@ -67,7 +66,7 @@ ___

### tmClient

• `Readonly` **tmClient**: *Client*
• `Readonly` **tmClient**: *Tendermint34Client*

## Methods

Expand Down Expand Up @@ -259,23 +258,6 @@ Name | Type | Description |

___

### getValidators

▸ **getValidators**(`blockHeight?`: *number*): *Promise*<ValidatorsResponse\>

Get all validators
Validators are sorted first by voting power (descending), then by address (ascending)

#### Parameters:

Name | Type | Description |
:------ | :------ | :------ |
`blockHeight?` | *number* | block height to return. If no height is provided, it will fetch validator set which corresponds to the latest block |

**Returns:** *Promise*<ValidatorsResponse\>

___

### searchTx

▸ **searchTx**(`queries`: *string*[], `page?`: *number*, `perPage?`: *number*, `includeProof?`: *boolean*): *Promise*<TxResponse[]\>
Expand All @@ -294,7 +276,7 @@ Name | Type | Default value | Description |
:------ | :------ | :------ | :------ |
`queries` | *string*[] | - | queries to run (see utils/search for helpers) |
`page` | *number* | 1 | page to query (default to 1) |
`perPage` | *number* | 30 | result per pages (default to 30) |
`perPage` | *number* | 30 | results per pages (default to 30) |
`includeProof?` | *boolean* | - | whether or not to include proofs of the transactions inclusion in the block |

**Returns:** *Promise*<TxResponse[]\>
Expand All @@ -303,7 +285,7 @@ ___

### signAndBroadcastTx

▸ **signAndBroadcastTx**(`wallet`: [*LumWallet*](lumwallet.md), `messages`: [*Message*](../interfaces/lummessages.message.md)[], `fee`: [*Fee*](../interfaces/lumtypes.fee.md), `memo?`: *string*): *Promise*<BroadcastTxCommitResponse\>
▸ **signAndBroadcastTx**(`wallet`: [*LumWallet*](lumwallet.md), `doc`: [*Doc*](../interfaces/lumtypes.doc.md)): *Promise*<BroadcastTxCommitResponse\>

Signs and broadcast the transaction using the specified wallet and messages

Expand All @@ -312,17 +294,15 @@ Signs and broadcast the transaction using the specified wallet and messages
Name | Type | Description |
:------ | :------ | :------ |
`wallet` | [*LumWallet*](lumwallet.md) | signing wallet |
`messages` | [*Message*](../interfaces/lummessages.message.md)[] | messages to sign |
`fee` | [*Fee*](../interfaces/lumtypes.fee.md) | requested fee |
`memo?` | *string* | optional memo for the transaction |
`doc` | [*Doc*](../interfaces/lumtypes.doc.md) | document to sign and broadcast as a transaction |

**Returns:** *Promise*<BroadcastTxCommitResponse\>

___

### signTx

▸ **signTx**(`wallet`: [*LumWallet*](lumwallet.md), `messages`: [*Message*](../interfaces/lummessages.message.md)[], `fee`: [*Fee*](../interfaces/lumtypes.fee.md), `memo?`: *string*): *Promise*<Uint8Array\>
▸ **signTx**(`wallet`: [*LumWallet*](lumwallet.md), `doc`: [*Doc*](../interfaces/lumtypes.doc.md)): *Promise*<Uint8Array\>

Signs the messages using the provided wallet and builds the transaction

Expand All @@ -331,9 +311,7 @@ Signs the messages using the provided wallet and builds the transaction
Name | Type | Description |
:------ | :------ | :------ |
`wallet` | [*LumWallet*](lumwallet.md) | signing wallet |
`messages` | [*Message*](../interfaces/lummessages.message.md)[] | messages to sign |
`fee` | [*Fee*](../interfaces/lumtypes.fee.md) | requested fee |
`memo?` | *string* | optional memo for the transaction |
`doc` | [*Doc*](../interfaces/lumtypes.doc.md) | document to sign |

**Returns:** *Promise*<Uint8Array\>

Expand Down
169 changes: 169 additions & 0 deletions docs/lib/classes/lumledgerwallet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
# Class: LumLedgerWallet

## Hierarchy

* [*LumWallet*](lumwallet.md)

↳ **LumLedgerWallet**

## Table of contents

### Constructors

- [constructor](lumledgerwallet.md#constructor)

### Properties

- [address](lumledgerwallet.md#address)
- [cosmosApp](lumledgerwallet.md#cosmosapp)
- [hdPath](lumledgerwallet.md#hdpath)
- [publicKey](lumledgerwallet.md#publickey)

### Methods

- [canChangeAccount](lumledgerwallet.md#canchangeaccount)
- [getAddress](lumledgerwallet.md#getaddress)
- [getAppConfiguration](lumledgerwallet.md#getappconfiguration)
- [getPublicKey](lumledgerwallet.md#getpublickey)
- [signTransaction](lumledgerwallet.md#signtransaction)
- [signingMode](lumledgerwallet.md#signingmode)
- [useAccount](lumledgerwallet.md#useaccount)

## Constructors

### constructor

\+ **new LumLedgerWallet**(`transport`: *Transport*<string\>): [*LumLedgerWallet*](lumledgerwallet.md)

#### Parameters:

Name | Type |
:------ | :------ |
`transport` | *Transport*<string\> |

**Returns:** [*LumLedgerWallet*](lumledgerwallet.md)

Inherited from: [LumWallet](lumwallet.md)

## Properties

### address

• `Protected` `Optional` **address**: *undefined* \| *string*

Inherited from: [LumWallet](lumwallet.md).[address](lumwallet.md#address)

___

### cosmosApp

• **cosmosApp**: *default*

___

### hdPath

• `Private` `Optional` **hdPath**: *undefined* \| *string*

___

### publicKey

• `Protected` `Optional` **publicKey**: *undefined* \| *Uint8Array*

Inherited from: [LumWallet](lumwallet.md).[publicKey](lumwallet.md#publickey)

## Methods

### canChangeAccount

▸ **canChangeAccount**(): *boolean*

**Returns:** *boolean*

Inherited from: [LumWallet](lumwallet.md)

___

### getAddress

▸ **getAddress**(): *string*

Gets the current wallet address

**`see`** [LumWallet.useAccount](lumwallet.md#useaccount)

**Returns:** *string*

wallet address (Bech32)

Inherited from: [LumWallet](lumwallet.md)

___

### getAppConfiguration

▸ **getAppConfiguration**(): *Promise*<{ `device_locked`: *boolean* ; `major`: *string* ; `test_mode`: *boolean* ; `version`: *string* }\>

Gets the connected application configuration

**Returns:** *Promise*<{ `device_locked`: *boolean* ; `major`: *string* ; `test_mode`: *boolean* ; `version`: *string* }\>

___

### getPublicKey

▸ **getPublicKey**(): *Uint8Array*

Gets the current wallet public key

**`see`** [LumWallet.useAccount](lumwallet.md#useaccount)

**Returns:** *Uint8Array*

wallet public key (secp256k1)

Inherited from: [LumWallet](lumwallet.md)

___

### signTransaction

▸ **signTransaction**(`doc`: [*Doc*](../interfaces/lumtypes.doc.md)): *Promise*<Uint8Array\>

#### Parameters:

Name | Type |
:------ | :------ |
`doc` | [*Doc*](../interfaces/lumtypes.doc.md) |

**Returns:** *Promise*<Uint8Array\>

Inherited from: [LumWallet](lumwallet.md)

___

### signingMode

▸ **signingMode**(): SignMode

**Returns:** SignMode

Inherited from: [LumWallet](lumwallet.md)

___

### useAccount

▸ **useAccount**(`hdPath`: *string*, `addressPrefix`: *string*): *Promise*<boolean\>

#### Parameters:

Name | Type |
:------ | :------ |
`hdPath` | *string* |
`addressPrefix` | *string* |

**Returns:** *Promise*<boolean\>

Inherited from: [LumWallet](lumwallet.md)
Loading