Skip to content
2 changes: 1 addition & 1 deletion docs/docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 1

# Getting Started

This documentation englobes the `xrpl-go` project, a Go SDK for interacting with the XRP Ledger.
This documentation covers the `xrpl-go` project, a Go SDK for interacting with the XRP Ledger.

## What is the XRP Ledger?

Expand Down
13 changes: 6 additions & 7 deletions docs/docs/keypairs.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
sidebar_position: 5
pagination_next: xrpl/currency
---

# keypairs

## Introduction
## Introduction

The keypairs package provides a set of functions for generating and managing cryptographic keypairs. It includes functionality for creating new keypairs, deriving public keys from private keys, and verifying signatures.

Expand All @@ -27,9 +28,9 @@ Cryptographic algorithms supported by this package are:
- ed25519
- secp256k1

Every function in the package that requires a cryptographic algorithm will accept any type that satisfies the `KeypairCryptoAlg` interface. So, if desired, you can implement your own algorithm and use it in this package.
Every function in the package that requires a cryptographic algorithm will accept any type that satisfies the `KeypairCryptoAlg` interface. So, if desired, you can implement your own algorithm and use it in this package.

However, the library already exports both algorithm getters that satisfy the `KeypairCryptoAlg` and `NodeDerivationCryptoAlg` interfaces. They're available under the package `github.com/Peersyst/xrpl-go/pkg/crypto`, which exports both algorithm getters that satisfy the `KeypairCryptoAlg`, `NodeDerivationCryptoAlg` interfaces.
However, the library already exports both algorithm getters that satisfy the `KeypairCryptoAlg` and `NodeDerivationCryptoAlg` interfaces. They're available under the package `github.com/Peersyst/xrpl-go/pkg/crypto`, which exports both algorithm getters that satisfy the `KeypairCryptoAlg`, `NodeDerivationCryptoAlg` interfaces.

### crypto package

Expand Down Expand Up @@ -73,7 +74,7 @@ They can be split into two groups:
func GenerateSeed(entropy string, alg interfaces.KeypairCryptoAlg, r interfaces.Randomizer) (string, error)
```

Generate a seed that can be used to generate keypairs. You can specify the entropy of the seed or let the function generate a random one (by passing an empty string as entropy and providing a randomizer) and use one of the supported algorithms to generate the seed. The result is a base58-encoded seed, which starts with the character `s`.
Generate a seed that can be used to generate keypairs. You can specify the entropy of the seed or let the function generate a random one (by passing an empty string as entropy and providing a randomizer) and use one of the supported algorithms to generate the seed. The result is a base58-encoded seed, which starts with the character `s`.

:::info

Expand All @@ -89,7 +90,6 @@ func DeriveKeypair(seed string, validator bool) (private, public string, err err

Derives a keypair (private and public keys) from a seed. If the `validator` parameter is `true`, the keypair will be a validator keypair; otherwise, it will be a user keypair. The result for both the private and public keys is a 33-byte hexadecimal string.


#### DeriveClassicAddress

```go
Expand Down Expand Up @@ -165,7 +165,6 @@ func main() {
}
```


### How to generate a new keypair from entropy

This example generates a new keypair using the `ED25519` algorithm and a provided entropy. Then, it derives the keypair and the address as the previous example.
Expand Down Expand Up @@ -199,4 +198,4 @@ func main() {
fmt.Println("Public Key: ", pubK)
fmt.Println("Address: ", addr)
}
```
```
7 changes: 6 additions & 1 deletion docs/docs/xrpl/currency.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
pagination_prev: keypairs
---

# currency

## Overview
Expand Down Expand Up @@ -32,4 +36,5 @@ func DropsToXrp(value string) (string, error)

// Non-standard currency codes conversions
func ConvertStringToHex(input string) string
func ConvertHexToString(input string) (string, error)
func ConvertHexToString(input string) (string, error)
```
22 changes: 19 additions & 3 deletions docs/docs/xrpl/hash.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

## Overview

The `hash` package contains functions and types related to the XRPL hash types. Currently, it only contains the function `SignTxBlob` that hashes a signed transaction blob, which is mainly used for multisigning.
The `hash` package contains functions for hashing XRPL transactions.

- `SignTxBlob`: Hashes a signed transaction blob. It accepts a signed transaction blob as input and returns the transaction's hash. This is mainly used for verifying transaction integrity, including multisigned transactions.

- `SignTx`: Hashes a signed transaction provided as a decoded map object. Primarily used internally for batch transactions within the wallet.

## Usage

Expand All @@ -14,6 +18,18 @@ import "github.com/Peersyst/xrpl-go/xrpl/hash"

## API

### SignTxBlob

```go
func SignTxBlob(txBlob string) ([]byte, error)
```

Hashes a signed transaction blob and returns the transaction hash or an error if the blob is invalid.

### SignTx

```go
func SignTxBlob(blob []byte, secret string) ([]byte, error)
```
func SignTx(tx map[string]interface{}) (string, error)
```

Hashes a signed transaction provided as a decoded map and returns the transaction hash or an error if the transaction object is invalid.
5 changes: 4 additions & 1 deletion docs/docs/xrpl/ledger-entry-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ The `ledger-entry-types` package contains types and functions to handle ledger o
- [`AccountRoot`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/accountroot)
- [`Amendments`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/amendments)
- [`AMM`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/amm)
- [`Credential`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/credential)
- `Delegate`
- [`Bridge`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/bridge)
- [`Check`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/check)
- [`DepositPreauth`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/depositpreauth)
Expand All @@ -21,6 +23,7 @@ The `ledger-entry-types` package contains types and functions to handle ledger o
- [`Offer`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/offer)
- [`Oracle`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/oracle)
- [`PayChannel`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/paychannel)
- [`PermissionedDomain`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/permissioneddomain)
- [`RippleState`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/ripplestate)
- [`SignerList`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/signerlist)
- [`Ticket`](https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/ticket)
Expand All @@ -33,4 +36,4 @@ To import the package, you can use the following code:

```go
import "github.com/Peersyst/xrpl-go/xrpl/ledger-entry-types"
```
```
Loading