Skip to content

Commit

Permalink
Merge pull request #1374 from ecadlabs/665-readme
Browse files Browse the repository at this point in the history
updated README for several packages
  • Loading branch information
dsawali authored Feb 1, 2022
2 parents 5b922f4 + e775c7d commit b7ca6a0
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 34 deletions.
19 changes: 15 additions & 4 deletions packages/taquito-beacon-wallet/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
# Taquito Beacon Wallet package
*Documentation can be found [here](https://tezostaquito.io/docs/wallet_API)*
*TypeDoc style documentation is available [here](https://tezostaquito.io/typedoc/modules/_taquito_beacon_wallet.html)*

`@taquito/taquito-beacon-wallet` is an npm package implementing the TZIP-10 standard that describes the communication between decentralized applications and wallets. The package provides developers a way to connect a dapp built with Taquito to a wallet giving the freedom to the users of the dapp to choose the wallet they want. It can be injected as follows:
## General Information
`@taquito/taquito-beacon-wallet` is an npm package implementing the TZIP-10 standard that describes the communication between decentralized applications and wallets. The package provides developers a way to connect a dapp built with Taquito to a wallet giving the freedom to the users of the dapp to choose the wallet they want.

## Install
Install the package as follows
```
npm install @taquito/beacon-wallet
```


## Usage
Create a wallet instance with defined option parameters and set the wallet provider using `setWalletProvider` to the `TezosToolkit` instance
```ts
import { TezosToolkit } from '@taquito/taquito';
import { BeaconWallet } from '@taquito/beacon-wallet';
Expand Down Expand Up @@ -32,11 +44,10 @@ Tezos.setWalletProvider(wallet);

```

See the top-level [https://github.com/ecadlabs/taquito](https://github.com/ecadlabs/taquito) file for details on reporting issues, contributing and versioning.
## Additional Info

## API Documentation
See the top-level [https://github.com/ecadlabs/taquito](https://github.com/ecadlabs/taquito) file for details on reporting issues, contributing and versioning.

TypeDoc style documentation is available on-line [here](https://tezostaquito.io/typedoc/modules/_taquito_beacon_wallet.html)

## Disclaimer

Expand Down
41 changes: 34 additions & 7 deletions packages/taquito-http-utils/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,47 @@
# Taquito HTTP Utilities package
*TypeDoc style documentation is available [here](https://tezostaquito.io/typedoc/modules/_taquito_http_utils.html)*

`@taquito/http-utils` is an npm package that provides developers with http functionality for Taquito.
`@taquito/http-utils` is an npm package that provides developers with http functionality for Taquito.

The `HttpBackend` class contains a `createRequest` method which accepts options to be passed for the HTTP request (url, method, timeout, json, query, headers, mimeType).
## General Information

The `HttpBackend` class contains a `createRequest` method which accepts options to be passed for the HTTP request (url, method, timeout, json, query, headers, mimeType). This method will help users interact with the RPC with a more familiar HTTP format.

Parameters for `createRequest`:

`url`(string): RPC URL pointing to the Tezos node
`method`(string): HTTP method of the request
`timeout`(number): request timeout
`json`(boolean): Parse response into JSON when set to `true`; defaults to `true`
`query`(object): Query that we would like to pass as an HTTP request
`headers`(object): HTTP request header
`mimeType`(string): Sets the MIME type of the request; see [MIME types](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)


## Install
The package(s) need to be installed as follows
```
npm install @taquito/http-utils
```

## Usage
Create an instance of `HttpBackend` and call it's member function `createRequest` to construct an HTTP request.
```ts
import { HttpBackend } from '@taquito/http-utils';

const http = new HttpBackend();
```
const httpBackend = new HttpBackend();
const response = httpBackend.createRequest<string>({
url: `/chains/${chain}/blocks/${block}/context/contracts/${address}/script`,
method: 'GET',
mimeType: "text; charset=utf-8",
json: false
});

See the top-level [https://github.com/ecadlabs/taquito](https://github.com/ecadlabs/taquito) file for details on reporting issues, contributing and versioning.
```

## API Documentation
## Additional Info
See the top-level https://github.com/ecadlabs/taquito file for details on reporting issues, contributing, and versioning.

TypeDoc style documentation is available on-line [here](https://tezostaquito.io/typedoc/modules/_taquito_http_utils.html)

## Disclaimer

Expand Down
44 changes: 27 additions & 17 deletions packages/taquito-ledger-signer/README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,38 @@
# Taquito Ledger Signer package
*Documentation can be found [here](https://tezostaquito.io/docs/ledger_signer)*
*TypeDoc style documentation is available [here](https://tezostaquito.io/typedoc/modules/_taquito_ledger_signer.html)*

## General Information
`@taquito/ledger-signer` is an npm package that provides developers with ledger signing functionality for Taquito. It implements the Signer interface of Taquito, allowing you to sign operations from a Ledger Nano device.

You first need to import the desired transport from the [LedgerJs library](https://github.com/LedgerHQ/ledgerjs). The Ledger Signer has currently been tested with `@ledgerhq/hw-transport-node-hid` for Node-based applications and with `@ledgerhq/hw-transport-u2f` for web applications.
You can pass an instance of the transport of your choice to your Ledger Signer as follows:
## Install
Install the package as follows
```
npm install @taquito/ledger-signer
```

## Usage
### Prerequisites
To use the Ledger Signer we must first import the desired transport from the [LedgerJs library](https://github.com/LedgerHQ/ledgerjs).

The Ledger Signer has currently been tested with `@ledgerhq/hw-transport-node-hid` for Node-based applications and with `@ledgerhq/hw-transport-webhi` for web applications.

Pass an instance of the transport of your choice to the Ledger Signer as follows:
```ts
import TransportU2F from '@ledgerhq/hw-transport-u2f';
import transportWeb from '@ledgerhq/hw-transport-webhi';
import { LedgerSigner } from '@taquito/ledger-signer';

const transport = await TransportU2F.create();
const transport = await transportWeb.create();
const ledgerSigner = new LedgerSigner(transport);
```

The constructor of the `LedgerSigner` class can take three other parameters. If none are specified, the default values are used.
The constructor of the `LedgerSigner` class takes three other optional parameters. If none are specified, the following default values are used:

- path: **default value is "44'/1729'/0'/0'"**
You can use as a parameter the `HDPathTemplate` which refers to `44'/1729'/${account}'/0'`. You have to specify what is the index of the account you want to use. Or you can also use a complete path as a parameter.
_More details about paths below_
- prompt: **default is true**
If true, you will be asked on your Ledger device to send your public key for validation. **_Note that confirmation is required when using `@ledgerhq/hw-transport-u2f`, so you should not set this parameter to false if you are using this transport._**
- derivationType: **default is DerivationType.ED25519**
- `path`: **default value is "44'/1729'/0'/0'"**
You can use as a parameter the `HDPathTemplate` which refers to `44'/1729'/${account}'/0'`. You have to specify the index of the account you want to use. Or you can also use a complete path as a parameter. More details about paths [here](https://tezostaquito.io/docs/ledger_signer#derivation-paths-hd-wallet--bip-standards)
- `prompt`: **default is true**
If true, you will be asked on your Ledger device to send your public key for validation. **_Note that confirmation is required when using `@ledgerhq/hw-transport-webhi`, so you should not set this parameter to false if you are using this transport._**
- `derivationType`: **default is DerivationType.ED25519**
It can be DerivationType.ED25519 (tz1), DerivationType.SECP256K1 (tz2) or DerivationType.P256 (tz3).

```ts
Expand All @@ -34,16 +46,16 @@ const ledgerSigner = new LedgerSigner(
);
```

## Usage
### Code Example

```ts
import { LedgerSigner } from '@taquito/ledger-signer';
import TransportNodeHid from '@ledgerhq/hw-transport-node-hid';
import TransportWeb from '@ledgerhq/hw-transport-webhi';
import { TezosToolkit } from '@taquito/taquito';

const Tezos = new TezosToolkit('https://YOUR_PREFERRED_RPC_URL');

const transport = await TransportNodeHid.create();
const transport = await TransportWeb.create();
const ledgerSigner = new LedgerSigner(transport);

Tezos.setProvider({ signer: ledgerSigner });
Expand All @@ -53,11 +65,9 @@ const publicKey = await Tezos.signer.publicKey();
const publicKeyHash = await Tezos.signer.publicKeyHash();
```

## Additional Info
See the top-level [https://github.com/ecadlabs/taquito](https://github.com/ecadlabs/taquito) file for details on reporting issues, contributing and versioning.

## API Documentation

TypeDoc style documentation is available on-line [here](https://tezostaquito.io/typedoc/modules/_taquito_ledger_signer.html)

## Disclaimer

Expand Down
47 changes: 41 additions & 6 deletions packages/taquito-local-forging/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,46 @@

# Taquito Local forging package
# Taquito Local Forging package
*TypeDoc style documentation is available [here](https://tezostaquito.io/typedoc/modules/_taquito_local_forging.html)*

`@taquito/local-forging` is an npm package that provides developers with local forging functionality for Taquito. It can be injected as follows:
## General Information

_Forging_ is the act of encoding your operation shell into its binary representation. Forging can be done either remotely by the RPC node, or locally. `@taquito/local-forging` is an npm package that provides developers with local forging functionality.


Operations must be _forged_ and _signed_ before it gets injected to the blockchain.

Example of an unforged operation:
```
{
branch: 'BLzyjjHKEKMULtvkpSHxuZxx6ei6fpntH2BTkYZiLgs8zLVstvX',
contents: [
{
kind: 'origination',
counter: '1',
source: 'tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn',
fee: '10000',
gas_limit: '10',
storage_limit: '10',
balance: '0',
script: [Object]
}
]
}
```

A forged operation:
```
a99b946c97ada0f42c1bdeae0383db7893351232a832d00d0cd716eb6f66e5616d0035e993d8c7aaa42b5e3ccd86a33390ececc73abd904e010a0a000000000011020000000c0500036c0501036c0502038d00000002030b
```

The forged values can then be parsed back into its JSON counterpart

## Install
Install the package as follows
```
npm install @taquito/local-forging
```
## Usage
```ts
import { TezosToolkit } from '@taquito/taquito'
import { LocalForger } from '@taquito/local-forging'
Expand All @@ -11,12 +49,9 @@ const Tezos = new TezosToolkit('https://YOUR_PREFERRED_RPC_URL');
Tezos.setProvider({ forger: localForger })
```

## Additional Info
See the top-level [https://github.com/ecadlabs/taquito](https://github.com/ecadlabs/taquito) file for details on reporting issues, contributing and versioning.

## API Documentation

TypeDoc style documentation is available on-line [here](https://tezostaquito.io/typedoc/modules/_taquito_local_forging.html)

## Disclaimer

THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 comments on commit b7ca6a0

Please sign in to comment.